Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 26920 - Stopping net.ppp0 service.
Summary: Stopping net.ppp0 service.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
: 26921 35933 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-08-19 05:50 UTC by Róbert Čerňanský
Modified: 2003-12-22 07:05 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch that solves described bugs. (net.ppp0-hs.diff,2.76 KB, patch)
2003-08-19 05:52 UTC, Róbert Čerňanský
Details | Diff
Patch that fixes PID getting. (net.ppp0-hs.diff,2.83 KB, patch)
2003-11-10 11:47 UTC, Róbert Čerňanský
Details | Diff
Added kill command into waiting loop. (net.ppp0-hs.diff,2.90 KB, patch)
2003-12-17 23:02 UTC, Róbert Čerňanský
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Róbert Čerňanský 2003-08-19 05:50:04 UTC
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.
Comment 1 Róbert Čerňanský 2003-08-19 05:52:15 UTC
Created attachment 16313 [details, diff]
Patch that solves described bugs.
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2003-08-19 06:05:50 UTC
*** Bug 26921 has been marked as a duplicate of this bug. ***
Comment 3 Chuck Brewer 2003-11-03 23:55:18 UTC
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.
Comment 4 Róbert Čerňanský 2003-11-10 11:40:45 UTC
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.
Comment 5 Róbert Čerňanský 2003-11-10 11:47:51 UTC
Created attachment 20537 [details, diff]
Patch that fixes PID getting.
Comment 6 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-11 05:42:39 UTC
tested poff meanwhile?
Comment 7 Róbert Čerňanský 2003-12-11 06:24:04 UTC
Not yet, not yet.
Comment 8 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-17 04:26:47 UTC
*** Bug 35933 has been marked as a duplicate of this bug. ***
Comment 9 Róbert Čerňanský 2003-12-17 22:54:46 UTC
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).
Comment 10 Róbert Čerňanský 2003-12-17 23:02:33 UTC
Created attachment 22394 [details, diff]
Added kill command into waiting loop.
Comment 11 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-22 07:05:07 UTC
fixed in 2.4.2_beta3-r1