Subject: Re: pppd & tail show PID after ppp-down
To: None <jklowden@schemamania.org>
From: Gan Uesli Starling <oinkfreebiker@att.net>
List: netbsd-help
Date: 10/15/2001 23:58:50
Howdy!

You wrote...

> Oh dear, that doesn't look good, does it?  You're sending a SIGHUP to
> the pppd pid, but never say boo to that "tail -f".
>
> To fix that, add the following line to ppp-down after the "kill -HUP":
>
> ps -T |perl -ne'print `kill -HUP $1` if m!^(\d+) .+tail -f
> /var/log/messages!'

Much to the same point, and rather less elegant, here's what I cobbled 
together for csh...

set foo = ` ps | grep tail | cut -d ' ' -f1 | tr '\n' ' ' `
if ( "$foo" !~ "" ) then
  kill $foo
endif

...or, if I don't mind having to ignore the OS whining about a misfired call 
to kill, that is...no args if tail-less...

kill ` ps | grep tail | cut -d ' ' -f1 | tr '\n' ' ' `

Your's at least can go straight into the script. Mine, being csh (I couldn't 
puzzle out the sh) has to be called as a separate script.

And I'm thinking that the complex kill of PPP is at least targeted to the 
specific TTY, where is our kills of tail do slay every tail that they doeth 
find, no? Could I, like, modify ppp-up to set a variable on which tail it 
started, and have ppp-down just yank down that one? Somebody might be running 
a second tail and not want it cut clean of without at least a by-your-leave.