9 プロセスの終了法

この章の目次へ

9.1 PPP では `dip -k' は使えますか?

いいえ、`dip -k' は使えません

chat のディレクトリの中に `ppp-off'というスクリプトがあり、こ のスクリプトが `dip -k' 同様に ppp 接続の終了に使えます。

このスクリプトは以下の通りです(切り出して、適切な名前にセーブし、chmod を使って実行可能にしてください)


#!/bin/sh
DEVICE=ppp0
#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
        if [ ! "$?" = "0" ]; then
                rm -f /var/run/$DEVICE.pid
                echo "ERROR: Removed stale pid file"
                exit 1
        fi
#
# Success. Let pppd clean up its own junk.
        echo "PPP link to $DEVICE terminated."
        exit 0
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1

9.2 PPP が終了した時にモデムが切れないんですが。

これにはいくつかの理由が考えられます。

前の章へ

この章の目次へ, この文書の目次へ

この文書の最初へ , この章の最初へ