From owner-freebsd-questions Tue Dec 3 17:54:18 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA28116 for questions-outgoing; Tue, 3 Dec 1996 17:54:18 -0800 (PST) Received: from wakko.gil.net (keithl@wakko.gil.net [207.100.79.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA28111 for ; Tue, 3 Dec 1996 17:54:16 -0800 (PST) Received: from localhost (keithl@localhost) by wakko.gil.net (8.8.3/8.8.2) with SMTP id UAA07042; Tue, 3 Dec 1996 20:54:32 -0500 Date: Tue, 3 Dec 1996 20:54:31 -0500 (EST) From: Keith Leonard To: Alain FAUCONNET cc: questions@freebsd.org Subject: Re: Shutdown of pppd In-Reply-To: <199612031335.AA07567@iaka.biomath.jussieu.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Thanks Alain, If I had thought (a lot of thought - I'm realitively (sp?) dense, on the order of a dwarf star) about the silly script I would have realized that kill -9 is absolute and doesn't allow pppd to clean up. Just tried your suggestion (change 'kill -9' to 'kill -INT' and pppd shutdown and cleaned up beautifully. This message is proof - I was able to dial back in within seconds of shuting down the connection. I guess the other OS (which shall remain nameless) has newbie-tolerance built in ;) Thanks again for you insight Keith keithl@gil.net On Tue, 3 Dec 1996, Alain FAUCONNET wrote: > Keith Leonard wrote / a ecrit: > > Howdy, > > > > I seem to be having a little problem with shutting down my internet > > connection. On another UN*X (which will remain unnamed) I use the > > following scripts (with small config changes) to start-up and shutdown my > > connection to the net (I am using kernel ppp and not tun): > > > > #!/bin/sh > > ps ax | grep pppd | grep -v grep > > PID=`ps ax | grep pppd | grep -v grep | awk '{print $1}'` > > > > if [ "$PID" = "" ] > > then > > pppd connect 'chat -v "" ATDTXXXXXXX CONNECT ""\ > > Name: XXXXXX Password: XXXXXXXXXXX' \ > > /dev/cuaa0 38400 : > > fi > > > I gather that you seem to be using the kernel version of PPP. Same as > the one I use (not on FreeBSD, but that should not be much relevant). > So far, so good. > > > > > > Not very elegant but it works for getting on - now for getting off: > > > > #!/bin/sh > > pid=`ps ax | grep pppd | grep -v grep | awk '{print$1;}'` > > if [ X${pid} != "X" ] ; then > > echo 'killing pppd, PID=' ${pid} > > kill -9 ${pid} > > route flush > > fi > > > > the route flush seems to work (added for FreeBSD) - Now here is the > > problem: > > > > If I try to reconnect within a short time (less than 10 minutes) pppd (I > > think) goes through the usual and then informs me that the address already > > exist (I assume the ISP assign address - dynamic) and I can get nowhere > > (telnet, ftp, etc). What do I need to clean up the mess that this > > inelegant soulution has produced so that I can relogin without rebooting > > (I'm on a standalone machine). > > > Sending a KILL signal to pppd is NOT a good idea. This signal is not > catchable and thus pppd exits abruptly. I hasn't got a chance to do > any cleanup, and that might be the cause for your trouble (route flush > should not be required if pppd exited cleanly nevertheless). > > I suggest replacing the "kill -9" by "kill -INT" or "kill -2". The > pppd daemon will catch that signal and exit cleanly. > > _Alain_ > -- > Alain FAUCONNET Ingenieur systeme - System Manager AP-HP/SIM > Public Health 91 bld de l'Hopital 75013 PARIS FRANCE > Medical Computing Research Labs Mail: af@biomath.jussieu.fr > Tel: (+33) (0)1-40-77-96-19 Fax: (+33) (0)1-45-86-80-68 > I've RTFMed. It says: "Refer to your system administrator" > But... I *am* the system administrator :-] >