Ta very much. Should work. Actually your typical pppd config has pppd detaching from the terminal once the connection is established, so it should be easy to grab the PID and save it.

P.

On Sep 19, 2007, at 10:29, Patrick Okui wrote:


On 19 Sep, 2007, at 10:06 AM, P. A. Bagyenda wrote:

Perhaps somebody has had to deal with this before:

You have more than one dialup link (created with a bare bones 'pppd call isp_x' and 'pppd call isp_y'). To bring down the link, we are told all that needs to happen is a 'killall pppd'. I would like however to bring down only one of the pppd links (say the one to isp_x) not both of them, which is what the killall does. Any ideas how to do this?

wrap the "pppd call isp_x" and "pppd call isp_y" in a shell script that saves the process IDs somewhere say /var/run/isp_x.pid and / var/run/isp_y.pid. (either by sending to the background and using the value of $! or using fork() or ... ).

Once that's done then all you have to do is kill `cat /var/run/ isp_x.pid` .


The alternative is to use ps and grep to find the PID pppd you want to bring down with kill. (Yes, I know what that sentence sounds like :D )

Patrick

PS:

Incidentally, on SuSE at least, there's a /sbin/startproc which given a -p will do the whole PID creation thing for you at which point you can use /sbin/killproc -p to kill the correct pppd. Not sure what OS you're trying this on and if it has something similar.
_______________________________________________
LUG mailing list
[email protected]
http://kym.net/mailman/listinfo/lug
%LUG is generously hosted by INFOCOM http://www.infocom.co.ug/

The above comments and data are owned by whoever posted them (including attachments if any). The List's Host is not responsible for them in any way.
---------------------------------------

_______________________________________________
LUG mailing list
[email protected]
http://kym.net/mailman/listinfo/lug
%LUG is generously hosted by INFOCOM http://www.infocom.co.ug/

The above comments and data are owned by whoever posted them (including 
attachments if any). The List's Host is not responsible for them in any way.
---------------------------------------

Reply via email to