I have a script that starts/restarts PPPoE/pppd (MTS aDSL) as required on a box. It used to work A-OK. After updates w ehil back (probably from Fedora 14 -> 16 I think) a weird thing started happening:
When my script is stopped (to be restarted after an update for instance), it instantly kills pppd and so my pppoe connection.
pppd[1572]: Terminating on signal 15 pppd[1572]: Connect time 7.5 minutes. pppd[1572]: Sent 136980 bytes, received 76924 bytes. pppd[1572]: Connection terminated. pppoe[1573]: read (asyncReadFromPPP): Session 14782: Input/output error pppoe[1573]: Sent PADT pppd[1572]: Exit.
sig 15 is SIGTERM.
I can see before this happens that the processes involved are at the root owned by init (ps 1):
root 4393 1 0 17:30 ? 00:00:00 /bin/bash /sbin/pppoe-connect /etc/sysconfig/network-scripts/ifcfg-ppp0 root 4417 4393 0 17:30 ? 00:00:00 /usr/sbin/pppd pty /usr/sbin/pppoe -p /var/run/pppoe-adsl.pid.pppoe -I eth0 -T 60 -U -m 1412 ipparam ppp0 linkname ppp0 noipdefault noauth default-asyncmap defaultroute hide-password nodetach mtu 1492 mru 1492 noaccomp nodeflate nopcomp novj novjccomp user thesuer lcp-echo-interval 20 lcp-echo-failure 3 nobody 4418 4417 0 17:30 ? 00:00:00 /usr/sbin/pppoe -p /var/run/pppoe-adsl.pid.pppoe -I eth0 -T 60 -U -m 1412
One would think that if it's been "daemonized" to be owned by init then killing the calling script would not affect it. But it is.
What my script actually call is ifup and then Fedora's network magic in turn calls pppoe/pppd. ifup itself exits right after doing this (which is probably why its children become children of init).
I tried adding a nohup before the ifup, but it doesn't help. I guess that makes sense since it's SIGTERM, not SIGHUP.
I'm out of ideas to make sure this stuff stays up after restarting my script, and don't know what could have changed in Fedora to make this happen.
Thanks!