/usr/share/doc/HOWTO/ja-html/Dial-On-Demand-7.html is in doc-linux-ja-html 2006.05.25-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Dial-On-Demand mini-HOWTO: ¥À¥¤¥¢¥ë¥ª¥ó¥Ç¥Þ¥ó¥É(Dial-on-Demand)</TITLE>
<LINK HREF="Dial-On-Demand-8.html" REL=next>
<LINK HREF="Dial-On-Demand-6.html" REL=previous>
<LINK HREF="Dial-On-Demand.html#toc7" REL=contents>
</HEAD>
<BODY>
<A HREF="Dial-On-Demand-8.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="Dial-On-Demand-6.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="Dial-On-Demand.html#toc7">Ìܼ¡¤Ø</A>
<HR>
<H2><A NAME="s7">7. ¥À¥¤¥¢¥ë¥ª¥ó¥Ç¥Þ¥ó¥É(Dial-on-Demand)</A></H2>
<P>Kerneld¤ÏPPP¤È¤¤¤Ã¤¿¥â¥¸¥å¡¼¥ë¤òɬÍפ˱þ¤¸¤Æ¥í¡¼¥É¤·¤Þ¤¹¡£kerneld-HOWTO
¤Ë½ñ¤«¤ì¤Æ¤¤¤ëÄɲõ¡Ç½¤Ï¡¤ÆÃÄê¤Î¥ë¡¼¥È¤¬¼º¤ï¤ì¤¿¤é¥¹¥¯¥ê¥×¥È¤ò¸Æ¤Ó½Ð¤¹¤È¤¤¤¦
µ¡Ç½¤¬¤¢¤ë¤È¤¤¤¦¤â¤Î¤Ç¤¹¡£Kerneld¤Ï¥·¥§¥ë¥¹¥¯¥ê¥×¥È<CODE>/sbin/request-route</CODE>¤òõ¤·¤Þ¤¹¡£°Ê²¼¤Î¥¹¥¯¥ê¥×¥È¤Ï<CODE>modules-2.0.0.tar.gz</CODE>¤Ë¤¢¤Ã¤¿
¥¹¥¯¥ê¥×¥È¤Î¥³¥Ô¡¼¤Ç¤¹¡£
<P>
<P>/sbin/request-route:
<HR>
<PRE>
#!/bin/sh
LOCK=/var/run/request-route.pid
export PATH=/usr/sbin:$PATH # for ppp-2.2*
# This script will be called from kerneld with the requested route as $1
# $1¤È¤·¤ÆÍ׵ᤵ¤ì¤ë¥ë¡¼¥È¤Ç¡¢¤³¤Î¥¹¥¯¥ê¥×¥È¤¬kerneld¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£
chatfile=/etc/ppp/$1
# If no chatscript exists use a default value (symlink to preferred script):
# chat¥¹¥¯¥ê¥×¥È¤¬¤Ê¤±¤ì¤Ð¥Ç¥Õ¥©¥ë¥ÈÃͤò»È¤¤¤Þ¤¹
# (»²¾È¤µ¤ì¤ë¥¹¥¯¥ê¥×¥È¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯)¡§
[ ! -f $chatfile ] && chatfile=/etc/ppp/default
# Check if we're already running:
# ¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤¹¤ë¡§
if [ ! -f $LOCK ] ; then
pppd connect "chat -f $chatfile" &
# Timer to be killed by ip-up, tunable! Check kerneld delay as well
# ip-up¤Ë¤è¤Ã¤Ækill¤µ¤ì¤ë¥¿¥¤¥Þ¡£Êѹ¹¤Ç¤¤Þ¤¹¡ªkerneld¤â¥Á¥§¥Ã¥¯¡£
sleep 60 &
sleepid=$!
echo $sleepid > $LOCK
wait $sleepid
rm -f $LOCK
exit 0
fi
exit 1
</PRE>
<HR>
Kerneld¤Ï°ú¿ô¤È¤·¤Æ̵¤¯¤Ê¤Ã¤¿¥ë¡¼¥È¤ò»È¤Ã¤¿¤³¤Î¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£
<PRE>
/sbin/request-route x.x.x.x
</PRE>
¥¹¥¯¥ê¥×¥È¤Ï'request-route'-Í×µá(instances)¤Î½ÅÊ£¤òËɤ°¤¿¤á¤Ë¥í¥Ã¥¯¥Õ¥¡¥¤¥ë
(<CODE>lock-file</CODE>)¤ò»È¤¤¤Þ¤¹(<EM>ÌõÃí¡§</EM>¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¥Ç¥Ð¥¤¥¹¤Ï¾¤«¤é
»ÈÍѤǤ¤Ê¤¤¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹)¡£
ºÇ½é¤Ï¥Í¡¼¥à¥µ¡¼¥Ð¤Ø¤Î»²¾È¤¬¤¢¤Ã¤¿»þ¤Ë¥¹¥¯¥ê¥×¥È¤¬µ¯Æ°¤µ¤ì¤ë¤è¤¦¤Ë
¤·¤Æ¤¤¤Þ¤·¤¿¡£¤·¤«¤·¡¢¥í¡¼¥«¥ë(=¼«Ê¬¤Î¥Þ¥·¥ó)¤Ç(¥¥ã¥Ã¥·¥åÍѤË)¥Í¡¼
¥à¥µ¡¼¥Ð¤òÁö¤é¤»¤è¤¦¤È¤¹¤ë¤È¡¢(ºÇ½é¤Î)»²¾È¤¬¥¥ã¥Ã¥·¥å¤µ¤ì¤ë¤¿¤á¡¢2
ÅÙÌÜ(°Ê¹ß)¤Î»²¾È¤Ç¤Ï(³°Éô¤Ø¥¢¥¯¥»¥¹¤¬Ìµ¤¤¤¿¤á)Àܳ¤¬³ÎΩ¤·¤Þ¤»¤ó¡£
<P>
<P>°Û¤Ê¤ë¥ê¥ó¥¯ÍѤΥÁ¥ã¥Ã¥È¥¹¥¯¥ê¥×¥È(chat-scripts)¤òÊ£¿ô¤Ä¤¯¤ë¤«
¥Ç¥Õ¥©¥ë¥È¤Î¥Á¥ã¥Ã¥È¥¹¥¯¥ê¥×¥È¤ÇISP(¥×¥í¥Ð¥¤¥À)¤ËÀܳ¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
<P>¥ê¥ó¥¯¤¬³ÎΩ¤µ¤ì¤¿¤épppd¤Ï<CODE>/etc/ppp/ip-up</CODE>¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£
¤³¤ì¤Ï¥í¥Ã¥¯¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤â¤Î¤Ç¤¹¡£sendmail¤Î¥¥å¡¼¼Â¹Ô(queue-run)¤Î¤è¤¦
¤Ë¡¢¥ê¥ó¥¯¤¬³ÎΩ¤µ¤ì¤ë»þ¤Ï¤¤¤Ä¤Ç¤â¼Â¹Ô¤·¤¿¤¤¥³¥Þ¥ó¥É¤òÄɲä·¤Þ¤¹¡£
<HR>
<PRE>
#!/bin/ash
LOCK=/var/run/request-route.pid
[ -f $LOCK ] && kill `cat $LOCK`
# Execute these commands after connecting:
# Àܳ¸å¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¡§
#/usr/sbin/sendmail -q
</PRE>
<HR>
'idle-disconnect'¥ª¥×¥·¥ç¥ó¤Ï¼«Æ°Åª¤Ë¥¢¥¤¥É¥ë¥ê¥ó¥¯¤òÀÚÃǤ·¤Þ¤¹¡£Ä¾ÀÜ
PPP¤òÀÚÃǤ¹¤ë¤È¤¤Ï'ppp-off'¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£
<P>/usr/sbin/ppp-off:
<HR>
<PRE>
#!/bin/sh
LOCK=/var/run/request-route.pid
DEVICE=ppp0
rm -f $LOCK
#
# If the ppp0 pid file is present then the program is running. Stop it.
# ppp0 PID¥Õ¥¡¥¤¥ë¤¬¤¢¤ì¤Ðkill¤¹¤ë¡£
if [ -r /var/run/$DEVICE.pid ]; then
kill -INT `cat /var/run/$DEVICE.pid`
#
# If unsuccessful, ensure that the pid file is removed.
# ÉÔÀ®¸ù¤Ê¤é¡¢PID¥Õ¥¡¥¤¥ë¤¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¡£
if [ ! "$?" = "0" ]; then
echo "removing stale $DEVICE pid file."
rm -f /var/run/$DEVICE.pid
exit 1
fi
#
# Success. Terminate with proper status.
# À®¸ù¡£Å¬Åö¤Ê¾õÂ֤ǽª¤ê¤Þ¤·¤¿¡£
echo "$DEVICE link terminated"
exit 0
fi
#
# The link is not active
# ¥ê¥ó¥¯¤¬¥¢¥¯¥Æ¥£¥Ö¤Ç¤Ï¤Ê¤¤¡£
echo "$DEVICE link is not active"
exit 1
</PRE>
<HR>
<P>
<P>
<HR>
<A HREF="Dial-On-Demand-8.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="Dial-On-Demand-6.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="Dial-On-Demand.html#toc7">Ìܼ¡¤Ø</A>
</BODY>
</HTML>
|