Page 1 of 1

Phoenix CE - Automatic restart of X windows after "crash"

Posted: Wed 31 Oct 2007, 23:23
by ecomoney
Hi all

I know this has been brought up many times on the forum by new users. When using puppy in the cybercafe with pre 2.15ce versions (which has this feature by default) this used to cause more problems than anything else. I was surprised when I first (re) booted 3.00 that it hadnt made it into the mainstream distro release as yet.

Basically the theory goes, if x crashes (or more frequently, the inexperienced user does not restart/shutdown the computer properly) currently puppy dumps you unexpectedly at a black screen full of (to a new linux user) unintelligible writing. Surely this can be handled more gracefully? The theory of handling the user interface of this feature would be to

1. Explain what happened
2. explain what could have caused it
3. suggest possible solutions (just restart x, drop to the command line or edit xorg.conf)

There are already discussions and fixes to this problem here and here

Posted: Thu 01 Nov 2007, 02:43
by cb88
I like the fix in the second post which is basically what was in 2.15CE it really is a good feature for noobs

Code: Select all

#v1.0.7 J_Reys idea (see note further down)... 
if [ -f /etc/.XLOADED ];then 
 if [ "`cat /etc/.XLOADED`" = "true" ];then 
  #last time X ran, PC hung and had to be rebooted, or wasnt shut down properly 

  dialog --timeout 5 --yes-label "Start Normally" --no-label "Recovery Console" --yesno "Last time the computer was on, it didnt shut down properly. This could be because it wasnt shutdown properly from the icon on the desktop or the start button, or possibly (though unlikely) that it has developed a fault. Just press [Enter] to start normally (recommended), or the other option to go to the repair console. Remember to always shut down the computer properly when you have finished using it." 0 0 
  
  if [ $? -ne 1 ]; then 
  #if [ $? = 0 ]; then 
   rm /etc/.XLOADED 
    exec xwin 
  else 
    echo -en "\\033[1;31m" #34=blue, 33=yellow, 32=green, 31=red, 35=purple, 36=aquablue, 38=black. 
    echo ' 
Have now dropped down to the commandline. If you want to run the Xorg 
Video Wizard, type "xorgwizard" and press [enter]. After setting up the graphics again, 
type "xwin" to start X.' 
    echo -e "\\033[0;39m" 
    rm -f /etc/.XLOADED #otherwise cannot start X. 
    exit 
  fi 
 fi

2.14r base

Posted: Mon 11 Feb 2008, 15:25
by ecomoney
with the new puppy 2.14r base from Dougal and Pakt, this feature is already implemented!

something that does cause problems though (and Ive noticed this with 2.15ce as well) is that if the ethernet cable is unplugged then the word "getting I.P. Address from eth0) is displayed along the bottom of the message, obscuring the "continue" or "recovery console" buttons. Just a little bug, but it could cause confusion when, say the user moves the computer and has to disconnect the cables.