Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 1996 20:54:31 -0500 (EST)
From:      Keith Leonard <keithl@wakko.gil.net>
To:        Alain FAUCONNET <af@biomath.jussieu.fr>
Cc:        questions@freebsd.org
Subject:   Re: Shutdown of pppd
Message-ID:  <Pine.LNX.3.95.961203204723.6946A-100000@wakko.gil.net>
In-Reply-To: <199612031335.AA07567@iaka.biomath.jussieu.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
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 :-]
> 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.3.95.961203204723.6946A-100000>