halt binary missing ifdown, breaks wake on lan, src compile works
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sysvinit (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Package: sysvinit-
Short: in "/sbin/halt", the "-i" switch fails.
Long: Please read through Debian bug #405870:
http://
Please also see Ubuntu bug #71418.
This following will describe "why 'halt' matters", but has nothing to do with the fact that "halt -i" is broken in "Ubuntu sysvinit", except to say that the version of "halt" from a source compile works correctly.
Because many network drivers fail to correctly manage the "wake on lan" (WOL) setting under all "start-up" and "shut-down" circumstances, for the WOL feature to function on the hardware, some network drivers need the network interface "down" when the computer system is halted - the 3c59x driver, for instance - while other drivers need the network interface to be "up" when the computer system is halted.
This situation with the network drivers is unfortunate. Many bug reports could be filed regarding the failure of various network drivers to properly set the "WOL" bits at system "shut-down" under varying circumstances. Nonetheless, "halt -i" should be fixed first.
In Debian bug #405870, Harry Coin says "Compiling 'halt' from the sysvinit sources results in a binary larger than the one in etch, and it works properly.", but does not say exactly _which_ "sources". I suppose he means simply the original Debian sources.
I have confirmed that "halt" compiled from the Ubuntu source archive, using "apt-get source sysvinit", does work correctly. The version of "halt" distributed in the Ubuntu binary package, sysvinit-
To check "halt", try "ifconfig; sudo halt -f -i -w; ifconfig". Note whether or not the active interface goes "down" and disappears from the "ifconfig" output.
A quick workaround, instead of compiling "halt" from source, and prior to an upgrade to "sysvinit": add this line to "/etc/init.d/halt", in the "do_stop" function, just before the line "halt -d -f -i $poweroff $hddown":
ifdown --force -a
if your driver needs the interface to be "down" to properly set the "WOL" bits.
If your driver needs the interface to be "up" to properly set the "WOL" bits, of course, also remove the "-i" switch from the following "halt" command, for when "halt" gets fixed.
And of course, for anybody who suddenly looses "WOL" when the "sysvinit" package is upgraded with a working "halt", they will need to modify "/etc/init.d/halt", or modify "/etc/defaults/
Some further notes for anyone having WOL problems:
After enabling the "WOL" feature in the system BIOS, some network drivers also require additional configuration using, perhaps individually, or perhaps in some combination:
/etc/modprobe.
a line like
options 3c59x enable_wol=1
or
sudo ethtool eth0
and
sudo ethtool -s wol g eth0
and/or
acpitool -w
and
sudo acpitool -W <some number>
Tedious and confusing, eh? Trial and error may help. All this is in addition to trying "shutdown" with the interface "up" and "shutdown" with the interface "down".
Also, some network hardware will completely loose the WOL setting if the system looses power. And some systems will fail to properly set the WOL bits when the system is first plugged in, no matter what is set in the BIOS. Ah well...
James
Ubuntu doesn't use the halt binary from the sysvinit source.
The halt binary Ubuntu uses comes from the upstart source, and is in compat/sysv