Subject: pppd & tail show PID after ppp-down
To: None <netbsd-help@netbsd.org>
From: Gan Uesli Starling <oinkfreebiker@att.net>
List: netbsd-help
Date: 10/15/2001 07:02:50
I have PPP going both ways now: I can either dial-out or dial-in at will. I'm 
writing my how-to on that. But there's just one or two things left that still 
bug me.

I use /etc/ppp/ppp-up and /etc/ppp/ppp-down from The NetBSD Guide by F. Lupi. 
And all the while I was iterating the process, after calling ppp-down, the 
link would fall (as expected) but on the next calling of ppp-up the on-screen 
messages from command "tail" in the ppp-up script would multiply.

When I explored this I noted that command "ps" would show PID's for ppp-up 
and tail both even after running ppp-down.

Now the PPP link had gone down. I see the lights go off on the dial-in box 
right beside it. But "tail" was obviously still running. And strangley, even 
though ppp-up still showed a PID, I could do ppp-up again without complaint. 
I could do this several times, and each ppp-up and tail would gain a new PID 
so that instancnes of messages would double/triple/quadruple, etc. I would 
have to go and kill them all specifically. That got so annoying that I wrote 
this script for the problem.

#!/bin/csh
# /etc/ppp/kill.csh
set foo = `ps | grep ppp-up | cut -d ' ' -f1 | tr '\n' ' ' `
if ( "$foo" !~ "" ) then
  kill $foo
endif
#
set bar = `ps | grep /var/log/messages | cut -d ' ' -f1 | tr '\n' ' ' `
if ( "$bar" !~ "" ) then
  kill $bar
endif
# EOF

And I now have this script called out at the end of /etc/ppp/ppp-down for the 
time being. But I'd like to get rid if it, if possible. Any ideas?



I am also a bit confused about when I do this on the laptop...

# dmesg | grep serial
com3 at pcmcia0 function 0 port 0x2e8-0x2ef: serial device
#

...and something I read which said I need to translate from COM to TTY by 
shifting toward zero so that, in effect, com3 = tty02, but this does NOT work.
It has to stay as, com3 = tty03, on the laptop. In KDE I can bring up an 
internet dialer screen and try all of the ttys, and only tty03 works, tty02 
does not work. Anybody know about this? Might there be a relationship to the 
above circumstance? Or have I gone off-track, was that wrong what I read?

Thanks,

Gan Starling
Kalamazoo MI USA