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 Sat 25 Oct 2014, 21:15
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 Posts_count  
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
Sub_title: 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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0425s ][ Queries: 11 (0.0050s) ][ GZIP on ]