The time now is Sun 19 May 2013, 10:28
All times are UTC - 4 |
| Author |
Message |
valer
Joined: 07 Nov 2011 Posts: 7 Location: Southern Finland
|
Posted: Mon 07 Nov 2011, 16:34 Post subject:
5.3 Shutdown doesn't work, restarts X - solution Subject description: This applies to Slacko 5.3 and possibly others |
|
I did a Slacko 5.3 frugal install on a USB stick with the universal installer, using the whole disk for saving (not a savefile). Usually, when I try to power-off or reboot, the screen goes black with a message saying that it's saving the session. After that, X just restarts (and Internet connection doesn't work).
I found why this happens. First, /sbin/poweroff or /sbin/reboot calls /etc/rc.d/rc.shutdown. That script tries to kill all stray processes (or something, I'm not really sure) on line 545, and all it does is that it kills itself (the poweroff or reboot process). So, the real /bin/busybox poweroff or reboot command never gets called in /sbin/poweroff or /sbin/reboot and X is restarted instead.
The quick solution is to use grep to filter out the poweroff and reboot processes so that they don't get killed. I'll try to hack something up that works. The real solution might be to rewrite the entire passage in rc.shutdown.
|
|
Back to top
|
|
 |
valer
Joined: 07 Nov 2011 Posts: 7 Location: Southern Finland
|
Posted: Mon 07 Nov 2011, 17:20 Post subject:
Patch that works for me |
|
This patch is based on raincheck's work, I thank him for it. It works for me but your mileage may vary. It's not tested in any other way.
Note that this bug may sometimes not come up. It may depend on the hardware used. Since it's a race condition, sometimes the other process wins and sometimes loses.
| Code: |
--- /etc/rc.d/rc.shutdown 2011-09-28 05:02:30.000000000 +0300
+++ /etc/rc.d/rc.shutdown.fixed 2011-11-08 00:03:03.000000000 +0200
@@ -542,7 +542,8 @@
[ ! "$ABSPUPHOME" ] && ABSPUPHOME="/initrd/mnt/dev_save" #v2.16rc
if [ "`busybox mount | grep "$ABSPUPHOME"`" != "" ];then
#BADPIDS="`fuser -v -m $ABSPUPHOME | grep -v --extended-regexp 'kernel|COMMAND|^$' | tr -s ' ' | cut -f 3 -d ' ' | tr '\n' ' '`"
- BADPIDS="`fuser -m $ABSPUPHOME 2>/dev/null`" #100107
+ #BADPIDS="`fuser -m $ABSPUPHOME 2>/dev/null`" #100107
+ BADPIDS="`fuser -v -m $ABSPUPHOME 2>&1 | grep F | grep -v reboot | grep -v poweroff | awk '{print $4}'`"
for ONEBAD in $BADPIDS
do
#echo "`eval_gettext \"Killing process \\\${ONEBAD}...\"`"
|
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|
[ Time: 0.0391s ][ Queries: 11 (0.0068s) ][ GZIP on ] |