(SP1) Improving shutdown

This is interesting, for the first time, the inbuilt wireless interface in my laptop is working. Using the ath_pci driver and I'm testing 4.1.1 "rc2".

However, I did a test install to a USB Flash drive, and without doing any network setup I get blinky with "wifi0" interface in the tray -- but not actually connected to the internet unless I run the Wizard.
Anyway, when I poweroff, about 50% of the time the laptop does not completely power-off. Now, I do recall some discussion about this -- both the ALSA modules have to be unloaded and the network interfaces brought down, to properly power-off -- I think that discussion was about the Aspire One.

I'm wondering if this power-off problem is specific to the 'ath_pci' driver (I don't recall what the Aspire One uses).

Anyway, 4.1.1rc has the ALSA module unloading in /etc/rc.d/rc.shutdown, and I have now added this:

#v411 run rc.alsa as it also unloads modules (if not done, prevents shutdown some systems)...

/etc/rc.d/rc.alsa stop

#v411 bring down network interfaces (prevents shutdown sometimes)...
for ONENETIF in `ifconfig | grep -E '^wifi[0-9]|^wlan[0-9]|^eth[0-9]' | cut -f 1 -d ' ' | tr '\n' ' '`
do
ifconfig $ONENETIF down 2> /dev/null
done


I have done 5 -6 shutdowns to test it, seems to work. But, anyone with more network config experience than me, do you think the above code can be improved?

Note, there was a suggestion to add the '-f' option to 'exec busybox poweroff -f' in /sbin/poweroff script, but that did not work, I still got failures to power-off completely.


Posted on 1 Nov 2008, 15:37


Comments:

Posted on 1 Nov 2008, 15:59 by BarryK
Shutdown failure
Curses, I tested a couple more times, on the last test the laptop power led stayed on.
So, the problem is not yet solved.


Posted on 1 Nov 2008, 16:38 by RickRandom
ath_pci
My NEC i-select uses an Atheros AR50055G wireless card with the ath_pci driver and shuts down fine with lots of Puppies, 2.x, 3.x, 4.x.

Sorry if not helpful...


Posted on 1 Nov 2008, 18:17 by tempestuous
unload both modules
The topic originally started in regard to the ASUS Eee. Both the ALSA module and wifi module appear to cause shutdown problems if they remain loaded.

Quote BarryK:
... and the network interfaces brought down, to properly power-off

Taking down the interface is a good idea, but the critical requirement is to go one step further and unload the wifi module. Whether this relates only to the ath_pci module is uncertain, because there is the complicating factor of the ALSA module also being a problem.


Posted on 1 Nov 2008, 19:22 by downsouth
eee shutdown
EEE only shutdown every 2nd or so time, so put this at end of rc.shutdown - now eee always shuts down.

sleep 2
killall dhcpcd
sleep 2
rmmod snd-hda-intel
sleep 2



Posted on 1 Nov 2008, 19:46 by Dougal
Stopping Networking
/etc/rc.d/rc.network stop

That only does the "cleaning up" (killing dhcpcd etc) and putting the interfce down, but I guess I can make it unload the modules, too (like rc.alsa does).


Posted on 2 Nov 2008, 8:17 by BarryK
rc.network
Ok, I've changed the code to calling 'rc.network stop'. As an experiment I also put in a line to unload ath_pci if it is loaded.


Posted on 2 Nov 2008, 20:55 by Leon
/root/Shutdown directory
It would be useful to have a /root/Shutdown directory similar to /root/Startup to save and execute user defined scripts.

I have this one:

rxvt -e pppoe-stop
sync
rxvt -e /opt/lampp/lampp stop
sync
/usr/X11R7/bin/wmpoweroff &