| Author |
Message |
gary101

Joined: 08 Oct 2006 Posts: 539 Location: Boston, Lincs. UK
|
Posted: Thu 31 May 2007, 14:18 Post subject:
Avoid problems with xorg after a powercut Subject description: ...or a bad shutdown |
|
My thanks to VendaVision for coming up with this whilst adapting puppy to run in kiosk mode. (I trust he has no objection to me using this for a workaround).
When puppy is unexpectedly shut down due to a power cut or similar it is often the case that xorg refuses to play nicely when the computer is rebooted.
As an example, I have 2.16 on a full hard drive install and after a power cut today I could not reboot into xorg. The xorgwizard did not make any difference and using xvesa created problems with my mouse. Even booting from cd and overwriting xorg.conf with a backup I always keep did not solve the problem.
This is where vendavisions post helped.
I edited the file /etc/rc.d/rclocal and added the following line:
echo -n "false" > /etc/.XLOADED
This seems to bypass the standard check on boot and allows you to go straight back to the dektop, presuming of course that your xorg.conf has not been corrupted.
My thanks again VendaVision. This will save a lot of frustration in future.
|
|
Back to top
|
|
 |
raffy
Joined: 25 May 2005 Posts: 4636 Location: Manila
|
Posted: Thu 31 May 2007, 19:15 Post subject:
simple |
|
Simple and effective, which can also be done by "rm -f /etc/.XLOADED". Only, nobody thought of doing it before VendaVision.
_________________ Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).
|
|
Back to top
|
|
 |
HairyWill

Joined: 26 May 2006 Posts: 2949 Location: Southampton, UK
|
Posted: Thu 31 May 2007, 22:05 Post subject:
|
|
I find it odd that puppy goes to the effort of including a mechanism to avoid a boot-crash loop that users then have to go to the effort of disabling. This fix has been around since I've been on the forum.
It would be much more user friendly if when .XLOADED was present, there was a 1 minute pause with explanation of how to abort before X was started regardless.
This question must come up at least once a month.
_________________ Will
contribute: community website, screenshots, puplets, wiki, rss
|
|
Back to top
|
|
 |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: Fri 01 Jun 2007, 00:33 Post subject:
|
|
In Pizzapup and Puppy 2.15, there was a dialog instead of the "Xwindows may have a problem, blah blah blah" message. It had two options: "try again" and "commandline". That way the proverbial Granny could hopefully just "try again".
Since then I've realized that the dialog program has an option for a time-out. So it could be enhanced further by having it continue as usual after a delay, as HairyWill proposed.
_________________ Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

|
|
Back to top
|
|
 |
ecomoney

Joined: 25 Nov 2005 Posts: 2183 Location: Lincolnshire, England
|
Posted: Wed 06 Jun 2007, 22:14 Post subject:
xwin problem |
|
This issue, more than any other, has caused more mayhem at the cybercafe than anything else!!!!
Its definetely a "feature" I would love to see removed in the mainstream puppy, and I was glad to see it had been in the puppy 2.15ce community edition, even if the wording was a little "technical".
In the new 2.15ce cybercafe setup, Ive modified /usr/bin/xwin (which runs when the window manager starts up at boot and does the checking) to this (from about line 287)
| Code: | #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 --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 [ $? = 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
fi |
I would love to enter say a five second timout so unless recovery console was selected (and perhaps an option to directly re-run the xorgwizard?), but my batch file programming falls well short! Im going to have a bash at it now (excuse the pun).
_________________ Puppy Linux's Mission
Sorry, my server is down atm!
|
|
Back to top
|
|
 |
GuestToo
Puppy Master
Joined: 04 May 2005 Posts: 4078
|
Posted: Wed 06 Jun 2007, 23:11 Post subject:
|
|
you could try changing:
dialog --yes-label
to:
dialog --timeout 5 --yes-label
and change:
if [ $? = 0 ]; then
to:
if [ $? -ne 1 ]; then
|
|
Back to top
|
|
 |
ecomoney

Joined: 25 Nov 2005 Posts: 2183 Location: Lincolnshire, England
|
Posted: Wed 06 Jun 2007, 23:18 Post subject:
Thanks |
|
Thanks Guestoo, worked like a charm!!!
My /usr/X11R7/bin/xwin file now reads
| Code: | #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 |
_________________ Puppy Linux's Mission
Sorry, my server is down atm!
|
|
Back to top
|
|
 |
legendofthor
Joined: 17 May 2007 Posts: 219 Location: Queensland Australia
|
Posted: Wed 29 Oct 2008, 17:37 Post subject:
|
|
/bump
cheers
martin
|
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 6866 Location: Perth, Western Australia
|
Posted: Wed 29 Oct 2008, 19:54 Post subject:
|
|
Why did you bump this thread (and waste my time)? Puppy4 has that code.
_________________ http://bkhome.org/blog2/
|
|
Back to top
|
|
 |
ecomoney

Joined: 25 Nov 2005 Posts: 2183 Location: Lincolnshire, England
|
Posted: Fri 31 Oct 2008, 07:34 Post subject:
Why? |
|
It was good to have a reminder of just how open source works. I work (and continue to work) with the "linux newbies" on a day to day basis, and since this feature was implemented, Ive seen the takeup rate of puppy linux on computers double from what it was - that is, twice as many people continue to use it after theyve tried it (that makes about 80% in my experience hehe).
Its down to developers (and distro managers) who will take on feedback from the non-technical/non-programmer users of puppy that makes it such a successful distribution, and makes linux in general ever more popular.
Thanks Barry + Developers for all your hard work
_________________ Puppy Linux's Mission
Sorry, my server is down atm!
|
|
Back to top
|
|
 |
alienjeff

Joined: 08 Jul 2006 Posts: 2290 Location: Winsted, CT - USA
|
Posted: Sat 01 Nov 2008, 10:13 Post subject:
|
|
| BarryK wrote: | | Why did you bump this thread ... |
Uh, to benefit the community?
| Quote: | | ... (and waste my time)? |
Oh, boo-fscking-hoo! Grow a pair, fgs.
Alternate rejoinder: Would you like some cheese with that whine?
| Quote: | | Puppy4 has that code. |
And most versions don't.
_________________ hangout: ##arch-ftw on irc.freenode.net
diversion: http://alienjeff.net - visit The Fringe
quote: "The foundation of authority is based upon the consent of the people." - Thomas Hooker
|
|
Back to top
|
|
 |
Eyes-Only

Joined: 10 Aug 2006 Posts: 1023 Location: La Confederation Abenaquaise
|
Posted: Sat 01 Nov 2008, 10:58 Post subject:
|
|
-I deleted my own comment before it disappeared-
aj
_________________ *~*~*~*~*~*
Proud user of LXpup and 3-Headed Dog.
*~*~*~*~*~*
|
|
Back to top
|
|
 |
ecomoney

Joined: 25 Nov 2005 Posts: 2183 Location: Lincolnshire, England
|
Posted: Sat 01 Nov 2008, 18:46 Post subject:
Point |
|
If im interpreting AJ's post correctly....the point hes making is....
It shouldnt have taken a year for a basic useability fault this serious shouldnt have taken a year to be fixed.
Maybe I should blame myself for not being persuading enough...
Puppy is one of the more challenging distros to work on for developers, because it requires both a high level of technical expertise, coupled with the ability for them to listen to the needs of the least technical of users.
_________________ Puppy Linux's Mission
Sorry, my server is down atm!
|
|
Back to top
|
|
 |
Colonel Panic

Joined: 16 Sep 2006 Posts: 1225
|
Posted: Wed 08 Apr 2009, 19:52 Post subject:
|
|
Thanks, I've had problems with powerouts in the past so this will come in very handy.
|
|
Back to top
|
|
 |
ernie
Joined: 06 Apr 2009 Posts: 7
|
Posted: Mon 13 Apr 2009, 21:07 Post subject:
|
|
Just an FYI -
Someone mentioned that this was fixed in 4.xx releases -
I installed the latest release on two different laptops and the the laptops get stuck at the bash "#" prompt on the next boot up when the power is cut or it is shut down abruptly. I see no message and nothing happens if i wait for a while.
The user needs to type reboot to fix it.
I will try this fix later - Its is exactly what I needed to make hand off systems - THANKS!
Ernie
|
|
Back to top
|
|
 |
|