Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 02 Sep 2014, 15:08
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
5.3 Shutdown doesn't work, restarts X - solution
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
valer

Joined: 07 Nov 2011
Posts: 7
Location: Southern Finland

PostPosted: 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
View user's profile Send private message 
valer

Joined: 07 Nov 2011
Posts: 7
Location: Southern Finland

PostPosted: 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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

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.0517s ][ Queries: 11 (0.0067s) ][ GZIP on ]