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:50
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to restart xwin automatically after hard reset?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [30 Posts]   Goto page: 1, 2 Next
Author Message
ecomoney


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

PostPosted: Tue 03 Oct 2006, 19:41    Post subject:  How to restart xwin automatically after hard reset?  

We help manage a local community cybercafe with puppy installed on 4 pc's. The staff there a far from computer literate and what happen a lot is that the people using them or the staff just swith them off at the mains when they are done. The next morning they all boot up to the prompt and I get an early morning wakeup call saying "The computers are broken, the screen is all black with funny writing on it" Wink

Would someone let me know what I could add to the startup file to make them automattically boot back into xwindows and assist my Monday morning Lie-ins?

Very much appreciated

Rob

_________________
Puppy Linux's Mission

Sorry, my server is down atm!

Last edited by ecomoney on Tue 12 Dec 2006, 21:53; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Tue 03 Oct 2006, 20:03    Post subject:  

edit /usr/X11R6/bin/xwin

comment the "exit" in this part, which is around line 210 in Puppy 2.10:

from
Code:
  echo '
It seems that last time X ran, the computer hung and you had to reboot.
Have now dropped down to the commandline. If you want to run the Xorg
Video Wizrd, type "xorgwizard", and after configuring /etc/X11/xorg.conf
(hopefully correctly this time!) type "xwin" to start X.'
  echo -e "\\033[0;39m"
  rm -f /etc/.XLOADED #otherwise cannot start X.
  exit
 fi
fi


to

Code:
  echo '
It seems that last time X ran, the computer hung and you had to reboot.
Have now dropped down to the commandline. If you want to run the Xorg
Video Wizrd, type "xorgwizard", and after configuring /etc/X11/xorg.conf
(hopefully correctly this time!) type "xwin" to start X.'
  echo -e "\\033[0;39m"
  rm -f /etc/.XLOADED #otherwise cannot start X.
#  exit
 fi
fi


Mark
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: Tue 03 Oct 2006, 20:51    Post subject: Thanks  

I should have put theyre still using puppy 1.09ce, However it seems to be the same. I edited the file and did a search for "It seems" and the same text came up, so I commented out the "exit" command, saved, and hit reset a (a "Crash Test" Rolling Eyes ) After checking the filesystem puppy booted back into X fine.

Thanks again for your help MU Cool

_________________
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 
gabev

Joined: 15 Nov 2006
Posts: 38
Location: New York, NY

PostPosted: Tue 28 Nov 2006, 01:56    Post subject:  

I've tried the same code and after the second hard crash test , i was again welcomed by the prompt.Seems that the .xinitrc has more than one place where it should be alter such that always after a hard crash it will boot in x.How did you fixed that?
Back to top
View user's profile Send private message 
ecomoney


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

PostPosted: Tue 28 Nov 2006, 05:57    Post subject: Hi  

Bit late replying to this post Embarassed

This didnt work either for us, but in the drop in centre where we have a cybercafe set up, the staff have learnt to type 'xwin' Razz

Would like to know the answer tho, because this issue still probably causes us more "support calls" then any other..... Wink Laughing

Would be great I think if this was the default behavior in puppy (it tries to start xwin every time). The worst that would happen in our experience (and I dont know all of the technical issues) would be that x fails and it drops back to the prompt anyway. (or perhaps a setup menu with the prompt and xorgwizard as options?). This would fit into puppys mission statement better.

_________________
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 
pakt


Joined: 04 Jun 2005
Posts: 1089
Location: Sweden

PostPosted: Tue 28 Nov 2006, 07:04    Post subject:  

I checked the code in 1.07 (which I still have as a frugal boot choice). You might try the following fix to always have Puppy start X:

Edit /etc/profile

The file ends like this:

Quote:
#want to go straight into X on bootup only...
if [ ! -f /tmp/bootcnt.txt ];then
#play.tcl /usr/share/audio/2barks.au &
touch /tmp/bootcnt.txt
rm -f /etc/.XLOADED
exec xwin
fi
fi


Just add the line in bold characters before 'exec xwin' and save the file.

EDIT: Make sure you reboot once so the modified file gets saved to pup_001!

IIRC, the file /etc/.XLOADED is a 'flag' file Barry put in to prevent Puppy from re-starting X if an incorrect video mode was chosen that made the display unusable. If the file contains "true", then Puppy was not properly shutdown and the user is dropped back to the prompt so that xorgwizard can be used to fix the problem.

The fix above simply removes the flag file which should disable the mechanism and make X always start.
HTH,
Paul

_________________
Testing Puppy since v0.9.2 - my desktop OS since v1.0.7
Running SlaxerPup-4.12 - Puppy with a Slackware 12.2 heart Cool

Last edited by pakt on Wed 13 Dec 2006, 04:27; edited 1 time in total
Back to top
View user's profile Send private message 
gabev

Joined: 15 Nov 2006
Posts: 38
Location: New York, NY

PostPosted: Tue 28 Nov 2006, 12:54    Post subject:  

hi pakt,

I've tried the code above and still no luck. Confused

But thank you for the description of the "flag" function.
Lets see.... if .xloaded value is set to true , than xwin will not start and you get a prompt..hmm but if .xloaded value is set to false.... then u dont get a prompt.

So , the solution is to set the value of .xloaded to false.Open the file in a text editor and instead of "true" put "false"..

damm , still no luck.... who writes the .xloaded value? if i can modify the way the flag is written to the .xloaded file than I can make the xwin automatically run at start after a hard crash.

I believe is kinda like :
if xwin shuts down properly , than .xloaded value is set to false and if xwin crashed than .xloaded is set to true.so all I gotta do is write the same value regardless of how xwin shuts.

Anyone knows where is the script which writes the .xloaded value?
Back to top
View user's profile Send private message 
pakt


Joined: 04 Jun 2005
Posts: 1089
Location: Sweden

PostPosted: Tue 28 Nov 2006, 13:25    Post subject:  

gabev, I didn't test it myself but I thought it would work. The 'flag' is written to by /usr/X11R6/bin/xwin.

I'll do a little more checking and see why my fix doesn't work.

_________________
Testing Puppy since v0.9.2 - my desktop OS since v1.0.7
Running SlaxerPup-4.12 - Puppy with a Slackware 12.2 heart Cool
Back to top
View user's profile Send private message 
pakt


Joined: 04 Jun 2005
Posts: 1089
Location: Sweden

PostPosted: Tue 28 Nov 2006, 13:57    Post subject:  

Ok, I just made a backup of my working 1.0.7 pup001 file, then re-booted into 1.0.7, modified /etc/profile as I described above and re-booted to save the change.

Then I re-booted into 1.0.7 again and when I got my desktop back, I switched off the PC with the reset button.

On the next boot, it did a "fixed unclean shutdown" routine and X started up automatically just like you wanted. No problem!

As far as I know, there were no major changes in this code between 1.0.7 and 1.09ce.

Paul

_________________
Testing Puppy since v0.9.2 - my desktop OS since v1.0.7
Running SlaxerPup-4.12 - Puppy with a Slackware 12.2 heart Cool
Back to top
View user's profile Send private message 
gabev

Joined: 15 Nov 2006
Posts: 38
Location: New York, NY

PostPosted: Tue 28 Nov 2006, 14:03    Post subject:  

hi pakt,

Yes , indeed, is xwin. I looked inside and I found where the "flag" is written.I set the value to false and after a hard crash I was able to restart in x but after a second test crash , i got a corupted ext2fs.... Crying or Very sad Of course i was expecting something like that to happened.

but otherwise it might work.I'll do more testing.

I'm actually using SimplePup0.3.1. Sorry I forgot to mention that.
Back to top
View user's profile Send private message 
Pizzasgood


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

PostPosted: Tue 28 Nov 2006, 15:16    Post subject:  

That actually works well as a "please remember to shut down your computer appropriately" type message. The problem is it isn't intuitive how to start back up. So, why not have it give you a menu or put you in a dialog thing, letting you choose to either continue booting, or "exit to prompt"? That way it will discourage cutting the power, but not need a tech to come "fix" it.

I don't have time to do it now, but if nobody else does by the weekend I can work on it.

_________________
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: Tue 28 Nov 2006, 19:32    Post subject: Startup  

I think that generally an enhanced "command prompt" menu would not be a bad thing, perhaps with numbered options like the startup menu...I remember along time ago doing menu with numbered batch files in DOS (1.bat > run xtreegold etc...by gum thats a long time ago). I suppose in linux the equivelent would be "1.sh" with a command to run xorgwizard inside, 2.sh - choose mouse etc etc.

The specific problem I have at the cybercafe though is that people leave by just switching off the power (or they just click "start>logout" which takes them back to the command prompt). I really need it to automatically return to xwindows on reboot by default in my case. What would be the possibility of making a puppy with an option of just booting into the command line from the initial startup boot menu, a bit like pressing F8 does in doze?

_________________
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: Tue 28 Nov 2006, 21:30    Post subject:  

you could do something like this:

in /usr/X11R7/bin/xwin, about line 238, change this:
Code:
  rm -f /etc/.XLOADED #otherwise cannot start X.
  exit
 fi
fi

to this:
Code:
  rm -f /etc/.XLOADED #otherwise cannot start X.
  dialog --msgbox "Naughty ... do not turn off the power switch" 0 0
  clear
 fi
fi


and about line 342, change this:
Code:
echo -n "false" > /etc/.XLOADED #see note above.
#...if PC hung, run xorgwizard at next bootup (see further up)

to this:
Code:
echo -n "false" > /etc/.XLOADED #see note above.
#...if PC hung, run xorgwizard at next bootup (see further up)
dialog --yesno "Shut down?" 0 0 && exec /sbin/poweroff
clear

or maybe:
Code:
echo -n "false" > /etc/.XLOADED #see note above.
#...if PC hung, run xorgwizard at next bootup (see further up)
dialog --yesno "Shut down?" 0 0 && exec /sbin/poweroff
exec xwin
Back to top
View user's profile Send private message 
Pizzasgood


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

PostPosted: Wed 29 Nov 2006, 19:01    Post subject:  

IceWM can be hacked to remove the logout button. If I remember right, you need to edit the source to omit the entire menu, then add a "shutdown" menu item in the menu file. You might be able to disable it in the preferences though.

If you need that, I can look into it sometime when I don't have so much stuff on my plate. I've already done something very similar, I'd just need to dig it out and look over it so I can remember how I did it.

_________________
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: Tue 12 Dec 2006, 21:52    Post subject: File Restore  

Doh, have noticed something. Every time I reboot the /usr/X11R7/bin/xwin file gets reset back to its origional. Hence the changes to make it start back up are lost. Is this file on the CD or something?

I believe there are other files that run after /usr/X11R7/bin/xwin, would it be possible to start xwin from there.?

_________________
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 
Display posts from previous:   Sort by:   
Page 1 of 2 [30 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
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.0878s ][ Queries: 11 (0.0031s) ][ GZIP on ]