FS#7555 - trivial fix: ifplugd.action should call /etc/rc.d/network ifup|ifdown

Attached to Project: Arch Linux
Opened by Loic Nageleisen (lloeki) - Tuesday, 03 July 2007, 13:33 GMT
Last edited by Thayer Williams (thayer) - Sunday, 01 February 2009, 22:50 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Kevin Piche (kpiche)
Thayer Williams (thayer)
Architecture All
Severity Medium
Priority Normal
Reported Version 2007.05 Duke
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

instead of copy-pasting stuff from /etc/rc.d/network, which leads to duplicated and offsync code (resulting in bugs like task 7204), /etc/ifplugd.action should look like:

case "$2" in
up)
/etc/rc.d/network hotplug_ifup $1
;;
down)
/etc/rc.d/network ifdown $1
;;
*)
echo "Wrong arguments" > /dev/stderr
;;
esac

notes:
- this fixes task #7204 (in a, IMHO, more consistent manner)
- this depends on task #7554 (because UP state != operational interface)

Additional info:
* extra/ifplugd 0.28-3


This task depends upon

Closed by  Thayer Williams (thayer)
Sunday, 01 February 2009, 22:50 GMT
Reason for closing:  Fixed
Additional comments about closing:  I believe this has been fixed--no other feedback provided.
Comment by Loic Nageleisen (lloeki) - Tuesday, 03 July 2007, 13:44 GMT
sorry, just a minor correction: logically, people using ifplugd add ifplgd as a daemon and remove ifplug-handled interfaces from INTERFACES in rc.conf, therefore they can't appear in iflist, and so hotplug_ifup would always fail...
so it should call ifup instead of hotplug_ifup.
Comment by Kevin Piche (kpiche) - Tuesday, 17 July 2007, 17:56 GMT
Waiting for status of task 7554.
Comment by Roman Kyrylych (Romashka) - Tuesday, 08 January 2008, 11:21 GMT
 FS#7554  is fixed. ;-)
Comment by Loic Nageleisen (lloeki) - Tuesday, 08 January 2008, 13:16 GMT
It is fixed, but mistakenly, since the commited fix doesn't work (see reopen request on #7554)
Comment by Loic Nageleisen (lloeki) - Monday, 14 January 2008, 09:02 GMT
#7554 now fixed. here's my working ifplugd.action
Comment by Michal Bůžek (smajchl) - Thursday, 21 February 2008, 18:49 GMT
I had the same problem and repaired it by editing ifplugd.action
<pre>
ifdown()
{
eval ifcfg="\$${1}"
if [ "$ifcfg" = "dhcp" ]; then
/sbin/dhcpcd -k ${1} #my update
#/bin/kill `cat /etc/dhcpc/dhcpcd-${1}.pid`
</pre>

I hope that will be repaired in new version ;-)
Comment by Loic Nageleisen (lloeki) - Thursday, 21 February 2008, 19:46 GMT
Michal, of course this works, but it is only moving the problem again, until /etc/rc.d/network gets updated again. code duplication is bad.
Comment by Michal Bůžek (smajchl) - Saturday, 23 February 2008, 13:43 GMT
Thanks for reply, i have done it because "/etc/rc.d/network ifdown wlan0" doesn't work (device is still up and dhcpcd is running)...
Comment by sibios (sibios) - Monday, 25 February 2008, 02:19 GMT
Hmmm, no luck with the action script that calls /etc/rc.d/network.
It brings the devices up but I have to call dhcp on the interfaces manually. Should this be counted as network scripts issue? Maybe just my config?
Comment by Loic Nageleisen (lloeki) - Monday, 25 February 2008, 09:40 GMT
though it is fixed in git, I don't think bug #7554 has reached core yet. did you apply the fixed line?
Comment by Loic Nageleisen (lloeki) - Monday, 25 February 2008, 09:42 GMT
also, be sure to have in rc.conf:

eth0=dhcp
INTERFACES=(!eth0)
ROUTES=(!gateway)

I vaguely remember having some problems otherwise.
Comment by sibios (sibios) - Monday, 25 February 2008, 20:45 GMT
That did the job. (The patch to /etc/rc.d/network)

...so, when do these fixes get packaged up and sent out? (when are they going to be made default fixes?)
Comment by Roman Kyrylych (Romashka) - Monday, 25 February 2008, 20:58 GMT
fix for  FS#7554  is already available in initscripts from Testing repo.
Comment by sibios (sibios) - Monday, 25 February 2008, 21:47 GMT
That did the job. (The patch to /etc/rc.d/network)

...so, when do these fixes get packaged up and sent out? (when are they going to be made default fixes?)
Comment by Thayer Williams (thayer) - Sunday, 07 December 2008, 06:28 GMT
I've bumped a rebuild of ifplugd to [testing]. I have incorporated the changes suggested in the OP, but I would really appreciate some feedback as I do not make use of gateway settings, etc. Thanks!

Loading...