1. When stopping service net.ppp0, pppd is not killed if link is not active (connection is not established). 2. When stopping service net.ppp0, pppd is not killed when the name of script is other than net.ppp0 (for example net.ppp0-myisp). Reproducible: Always Steps to Reproduce: first case 1. Configure pppd to be persistent. 2. Do something that pppd will not connect (for ex. turn off modem). 3. Start net.ppp0 service. 4. Stop net.ppp0 service. second case 1. Copy service init.d/net.ppp0 to init.d/net.ppp0-myisp. 2. Copy conf.d/net.ppp0 to conf.d/net.ppp0-myisp. 3. Add net.ppp0-myisp to default runlevel. 4. Start net.ppp0-myisp service. 5. Stop net.ppp0-myisp service. Actual Results: pppd remains running. Expected Results: 1. Init script should kill pppd even if link is not active or print error message if pppd can not be killed. 2. Init script should stop pppd even if name of net.ppp0 service is different. I rewrote little bit "stop" section of init script /etc/init.d/net.ppp0. I'm attaching a patch (original file had this version in header: "1.14 2003/05/18 21:51:34"). This patch solve both described bugs. In first case script goes to kill pppd even if "$(/sbin/ifconfig | egrep "${IFNAME}")" returns zero. In second case, when script have a different name, the interface name is obtained from .pid file and used when necessary. In both cases is checked if pppd was successfully killed. I have taken idea of this from init.d/q3ded-osp. And finally I added one new feature. Script can be now configured not to generate chat script even if AUTOCFGFILES is set to "yes". I found it useful when I use two net.ppp0-* scripts and one of its needs special chat script. This feature have variable AUTOCHATSCRIPT in conf.d/net.ppp0 file. Variable can have "yes" or "no" values. I hope that this will be usefull.
Created attachment 16313 [details, diff] Patch that solves described bugs.
*** Bug 26921 has been marked as a duplicate of this bug. ***
That's pretty elegant overall, lots of lines added:) I think I would've just done a poff -a after the kills in "Bringing ${IFACE} down" myself. Unless of course you're running two different instances of pppd through two different modems on the same box..seems unlikely but you never know.
Thanks for your advice, I didn't know poff script. Sometimes pppd cannot be killed. If poff helps in this case and terminate pppd correctly, it would be good reason to put it there. I'll test it when I will have time. Now I made new patch. It fixes getting of PID from pstree output. Previous patches are now obsolete.
Created attachment 20537 [details, diff] Patch that fixes PID getting.
tested poff meanwhile?
Not yet, not yet.
*** Bug 35933 has been marked as a duplicate of this bug. ***
OK, I tested poff script, but it brings no advantage. It just kills pppd in normal way. During this test I find out that pppd sometimes(*) don't catch SIGTERM, that is send by kill (from net.ppp0 script). So waiting for pppd to finish is useless in this case. So I added kill command into the waiting loop too. It works - if pppd don't catch first SIGTERM, it catch one of next that is send from loop. I'm attaching a new patch. (*) This happens under conditions that I described in first point of this bug report (when connection is not established).
Created attachment 22394 [details, diff] Added kill command into waiting loop.
fixed in 2.4.2_beta3-r1