Bullwinkle: Hey Rocky, watch me pull a rabbit out of my hat.
Rocky: But that trick never works.
Bullwinkle: This time for sure.
Presto!
Well, I'm gettin' close.
Rocky: And now it's time for another special feature.
--- "Rocky and His Friends"
XmDipmon Àº ÀÎÅÍ³Ý ¿¬°á »óŸ¦ º¸¿©ÁÖ´Â ¹öÆ°À» Ç¥½ÃÇÏ´Â ÀÛ°í Àç¹ÌÀÖ´Â ÀÀ¿ë ÇÁ·Î±×·¥ÀÌ´Ù. ³°Àº Àüȼ±¿¡¼´Â ÈçÈ÷ ¿¬°áÀÌ ²÷¾îÁö°ï Çϴµ¥, ±×·± °æ¿ì¿¡´Â ¹Ý¦°Å¸®¸é¼ °æ°íÀ½À» ³½´Ù. ºÒÇàÈ÷µµ, XmDipmonÀº dip °ú¸¸ ÀÛµ¿Çϴµ¥, À̶§¹®¿¡ ÀÎÅÍ³Ý ¿¬°á¿¡ chat¸¦ ¾²´Â ´ëºÎºÐÀÇ »ç¶÷µé¿¡°Ô´Â ¾µ¸ð°¡ ¾ø´Ù.
XmDipmon À» ÄÄÆÄÀÏÇÏ´Â °ÍÀº ¹®Á¦°¡ ¾Æ´Ï´Ù. XmDipmonÀº Motif ¶óÀ̺귯¸®¿¡ ¸µÅ©µÇ¾î ÀÖÁö¸¸, Lesstif¿Íµµ Àß ÄÄÆÄÀϵǰí Àß ½ÇÇàµÈ´Ù. À̹ø µµÀüÀº chat¸¦ ¾µ ¶§µµ ÀÛµ¿µÇµµ·Ï ÆÐÅ°Áö¸¦ °íÄ¡´Â °ÍÀÌ´Ù. ÀÌ ÀÛ¾÷Àº ½ÇÁ¦·Î ¼Ò½º Äڵ带 ¶«ÁúÇÏ´Â °Í±îÁö Æ÷ÇÔÇÏ°í ÀÖÀ¸¸ç, µû¶ó¼ ÇÁ·Î±×·¡¹Ö¿¡ ´ëÇÑ Áö½ÄÀÌ ¾î´À Á¤µµ ÇÊ¿äÇÏ´Ù.
"½ÇÇàµÇ¸é, xmdipmon Àº /etc/dip.pid ¶ó´Â ÆÄÀÏÀ» È®ÀÎÇÑ´Ù. (-pidfile ÀÇ
¸í·ÉÇà ÀÎÀÚ¸¦ ½á¼ ´Ù¸¥ ÆÄÀÏÀ» ãµµ·Ï ÇÒ ¼öµµ ÀÖ´Ù.) ÀÌ ÆÄÀÏÀº dip
µ¥¸óÀÇ PID ¸¦ Æ÷ÇÔÇÏ°í ÀÖ´Ù. (dip ´Â ÀÏ´Ü ¿¬°áÀÌ ÀÌ·ç¾îÁö¸é ÀÚ½ÅÀ»
µ¥¸ó ¸ðµå·Î ÀüȯÇÑ´Ù.)"
--- XmDipmon README ÆÄÀϷκÎÅÍ Àοë.
-pidfile ¿É¼ÇÀ» ÁÖ¾î ½ÇÇàÇϸé, XmDipmonÀÌ chat ·Î±×ÀÎÀÌ ¼º°øÇßÀ» ¶§¿¡¸¸ Á¸ÀçÇÏ´Â ´Ù¸¥ ÆÄÀÏÀ» È®ÀÎÇϵµ·Ï ÇÒ ¼ö ÀÖ´Ù. ¸í¹éÇÑ È帴 ¸ðµ©ÀÇ lock ÆÄÀÏÀÌ´Ù. µû¶ó¼ xmdipmon -pidfile /var/lock/LCK..ttyS3 ·Î ÇÁ·Î±×·¥À» ½ÇÇà½ÃÄÑ º¸ÀÚ. (ÀÌ ¸í·ÉÀº ¸ðµ©ÀÌ 4¹ø com Æ÷Æ®, Áï ttyS3¿¡ ÀÖ´Ù°í °¡Á¤ÇÑ °ÍÀÌ´Ù.) ÇÏÁö¸¸ ÀÌ°ÍÀº ¹®Á¦ÀÇ ÀϺθ¦ Ǭ °ÍÀÏ »ÓÀÌ´Ù. ÇÁ·Î±×·¥Àº °è¼Ó dip µ¥¸óÀ» °¨½ÃÇϸç, µû¶ó¼ ¿ì¸®´Â dip µ¥¸ó ´ë½Å chat³ª ppp¿Í °ü·ÃµÈ ÇÁ·Î¼¼½º¸¦ °¨½ÃÇϵµ·Ï ¹Ù²ã¾ß ÇÑ´Ù.
¼Ò½º ÆÄÀÏÀº Çϳª ¹Û¿¡ ¾øÀ¸¸ç, ´ÙÇàÈ÷µµ ÁÖ¼®¹®ÀÌ Àß ´Þ·ÁÀÖ´Ù.
xmdipmon.c
ÆÄÀÏÀ» º¸¸é, Çì´õ°¡ ¾Æ·¡¿Í °°ÀÌ µÇ¾î ÀÖ´Â
getProcFile ÇÔ¼ö¸¦ ãÀ» ¼ö ÀÖ´Ù.
/*****
* Name: getProcFile
* Return Type: Boolean
* Description: tries to open the /proc entry as read from the dip pid file.
<snip>
*****/
°áÁ¤ÀûÀÎ ´Ü¼´Ù. ÇÔ¼ö ³»ºÎ¸¦ ã¾Æº¸ÀÚ.
/* we watch the status of the real dip deamon */
sprintf(buf, "/proc/%i/status", pid);
procfile = (String)XtMalloc(strlen(buf)*sizeof(char)+1);
strcpy(procfile, buf);
procfile[strlen(buf)] = '\0';
¹üÀÎÀº 2383° ÁÙÀÌ´Ù.
sprintf(buf, "/proc/%i/status", pid);
^^^^^^^^^^^^^^^^^^^^^
ÀÌ ÇÔ¼ö°¡ dip µ¥¸ó ÇÁ·Î¼¼½º°¡ ½ÇÇàµÇ°í ÀÖ´ÂÁö °Ë»çÇÏ´Â °ÍÀÌ´Ù. ±×·¯¸é, ´ë½Å pppd µ¥¸óÀ» °¨½ÃÇϵµ·Ï ÇÏ·Á¸é ÀÌ ºÎºÐÀ» ¾î¶»°Ô °íÄ¡¸é µÉ±î?
pppd ÀÇ ¸ÇÆäÀÌÁö¸¦ º¸ÀÚ.
FILES
/var/run/pppn.pid (BSD or Linux), /etc/ppp/pppn.pid (others)
Process-ID for pppd process on ppp interface unit n.
xmdipmon.c
ÀÇ 2383° ÁÙÀ» ¾Æ·¡¿Í °°ÀÌ °íÄ¡ÀÚ.
sprintf(buf, "/var/run/ppp0.pid" );
°íÄ£ ÆÐÅ°Áö¸¦ ´Ù½Ã ÄÄÆÄÀÏÇÏÀÚ. ¹®Á¦¾øÀÌ ÄÄÆÄÀϵȴÙ.
ÀÌÁ¦ »õ·Î¿î ¸í·ÉÇà ÀÎÀÚ¸¦ ½á¼ ½ÃÇèÇØ º¸ÀÚ. ¾Æ¸¶ ½ÅÅëÇÏ°Ô Àß ½ÇÇàµÉ °ÍÀÌ´Ù.
ÀÎÅÍ³Ý ¼ºñ½º Á¦°øÀÚ(ISP)·Î ppp
¿¬°áÀÌ ÀÌ·ç¾îÁ® ÀÖÀ» ¶§¿¡´Â
ÀÛ°í ÆĶõ ¹öÆ°ÀÌ Ç¥½ÃµÇ°í, ¿¬°áÀÌ ²÷¾îÁö¸é ¹Ý¦°Å¸®¸é¼ °æ°íÀ½À» ³½´Ù.
ÀÌÁ¦ ¿ì¸®´Â ¿Ïº®ÇÏ°Ô ÀÛµ¿ÇÏ´Â chat ¸ð´ÏÅ͸¦ °®°Ô µÇ¾ú´Ù.
XmDipmon´Â Ripley Linux Tools¿¡¼ ´Ù¿î¹ÞÀ» ¼ö ÀÖ´Ù.