Previous Next Table of Contents

9. Process termination

9.1 Is there a \dip -k\ for PPP?

No. There is no \dip -k\.

However, if you run dip -k, and have properly built the dip process so that it knows that the lock file directory is /var/locks, then you may use the command to terminate the pppd process. The reason that this works is that dip will terminate any process which owns the tty device, not just the one which it started. This may be a security concern for some (perhaps many) people. However, it is just the way that the program works. If you are concerned about dip doing this action then either secure dip so that it is executable by only specific people or remove it from your system and use slattach, route, ifconfig, and arp to do the dial-in functions of SLIP.

In the chat directory, there is a \PPP-off\ script. This will stop the PPP link in the same manner as the \dip -k\.

I have included it below. (Cut it out. Store it in its own file.

Make the file executable with 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 `head -1 /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

In addition, you may still use \dip -k\ to terminate the pppd link. The reason is that dip does not care if it started the program which is using the serial device. It sends a SIGTERM to any process which owns the serial device. (This is not a great idea, however, that is the way that dip works.)

9.2 PPP does not hangup the modem when it terminates

There are several reasons for this.


Previous Next Table of Contents