halt binary missing ifdown, breaks wake on lan, src compile works

Bug #127010 reported by james
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Package: sysvinit-2.86.ds1-14.1ubuntu18

Short: in "/sbin/halt", the "-i" switch fails.

Long: Please read through Debian bug #405870:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=405870

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-2.86.ds1-14.1ubuntu18, does NOT work correctly.

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/halt" if someone is polite enough to include Harry Coin's "NETDOWN" option in "/etc/defaults/halt" and in "/etc/init.d/halt". There should be a note about this added in the upgrade.

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.d/options
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

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

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

Revision history for this message
Andreas Moog (ampelbein) wrote : Old standing report

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thank you for taking the time to report this bug and helping to make
Ubuntu better. You reported this bug a while ago and there hasn't been
any activity in it recently. We were wondering is this still an issue
for you? Can you try with latest Ubuntu release? Thanks in advance.

 status incomplete
 subscribe

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkiwi5EACgkQ06FgkPZwicQJfgCdFL6G+JeaBLzL8uW4p8lCMQRt
01wAoPDy4HdqIFozDCy4KUqMPMh3J/qf
=gM43
-----END PGP SIGNATURE-----

Changed in sysvinit:
status: New → Incomplete
Revision history for this message
MMlosh (mmlosh) wrote :

He's right; "halt -i" has no effect.

"man halt" says "On Linux, this is unnecessary as the kernel will do this anyway."
And that's probably my problem: kernel will do this anyway; If I want to or not..

Revision history for this message
Victor Vargas (kamus) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in sysvinit (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.