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 Wed 16 Apr 2014, 04:35
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Avoid problems with xorg after a powercut
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Author Message
gary101


Joined: 08 Oct 2006
Posts: 539
Location: Boston, Lincs. UK

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

Joined: 25 May 2005
Posts: 4752
Location: Manila

PostPosted: 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. Smile
_________________
Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

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


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: 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
View user's profile Send private message Visit poster's website 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: 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
View user's profile Send private message Visit poster's website MSN Messenger 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

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


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: 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
View user's profile Send private message Visit poster's website MSN Messenger 
legendofthor

Joined: 17 May 2007
Posts: 219
Location: Queensland Australia

PostPosted: Wed 29 Oct 2008, 17:37    Post subject:  

/bump

cheers
martin
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: 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/news/
Back to top
View user's profile Send private message Visit poster's website 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: 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
View user's profile Send private message Visit poster's website MSN Messenger 
alienjeff


Joined: 08 Jul 2006
Posts: 2290
Location: Winsted, CT - USA

PostPosted: 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: ##b0rked 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
View user's profile Send private message 
Eyes-Only


Joined: 10 Aug 2006
Posts: 1046
Location: La Confederation Abenaquaise

PostPosted: Sat 01 Nov 2008, 10:58    Post subject:  

-I deleted my own comment before it disappeared-

Wink aj

_________________
*~*~*~*~*~*
Proud user of LXpup and 3-Headed Dog. Cool
*~*~*~*~*~*
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: 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
View user's profile Send private message Visit poster's website MSN Messenger 
Colonel Panic


Joined: 16 Sep 2006
Posts: 1438

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

Joined: 06 Apr 2009
Posts: 7

PostPosted: 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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
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.0793s ][ Queries: 12 (0.0053s) ][ GZIP on ]