How to restart xwin automatically after hard reset?
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"
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
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
Last edited by ecomoney on Wed 13 Dec 2006, 01:53, edited 1 time in total.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
edit /usr/X11R6/bin/xwin
comment the "exit" in this part, which is around line 210 in Puppy 2.10:
from
to
Mark
comment the "exit" in this part, which is around line 210 in Puppy 2.10:
from
Code: Select all
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
Code: Select all
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
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" ) After checking the filesystem puppy booted back into X fine.
Thanks again for your help MU
Thanks again for your help MU
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
Hi
Bit late replying to this post
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'
Would like to know the answer tho, because this issue still probably causes us more "support calls" then any other.....
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.
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'
Would like to know the answer tho, because this issue still probably causes us more "support calls" then any other.....
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 [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
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:
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
Edit /etc/profile
The file ends like this:
Just add the line in bold characters before 'exec xwin' and save the file.#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
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
Last edited by pakt on Wed 13 Dec 2006, 08:27, edited 1 time in total.
Methinks Raspberry Pi were ideal for runnin' Puppy Linux
hi pakt,
I've tried the code above and still no luck.
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?
I've tried the code above and still no luck.
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?
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
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
Methinks Raspberry Pi were ideal for runnin' Puppy Linux
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.... 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.
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.... 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.
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
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.
I don't have time to do it now, but if nobody else does by the weekend I can work on it.
[size=75]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[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
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?
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 [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
you could do something like this:
in /usr/X11R7/bin/xwin, about line 238, change this:
to this:
and about line 342, change this:
to this:
or maybe:
in /usr/X11R7/bin/xwin, about line 238, change this:
Code: Select all
rm -f /etc/.XLOADED #otherwise cannot start X.
exit
fi
fi
Code: Select all
rm -f /etc/.XLOADED #otherwise cannot start X.
dialog --msgbox "Naughty ... do not turn off the power switch" 0 0
clear
fi
fi
Code: Select all
echo -n "false" > /etc/.XLOADED #see note above.
#...if PC hung, run xorgwizard at next bootup (see further up)
Code: Select all
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
Code: Select all
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
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
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.
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.
[size=75]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[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
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.?
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 [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
/usr/X11R7/bin/xwin should not be changed when Puppy boots, unless you are upgrading to a newer version of Puppy ... if it is, i don't know why it would be doing that
you could copy xwin somewhere, for example, to /root/my-applications/bin, then a line like this in rc.local would restore your modifed version of xwin every time Puppy boots:
cp -f /root/my-applications/bin/xwin /usr/X11R7/bin/
but if Puppy upgrades and has a newer version of xwin, the newer xwin will be replaced by your modifed version ... you could cp the file only if the puppyversion is still 212:
grep -q 212 /etc/puppyversion && cp -f /root/my-applications/bin/xwin /usr/X11R7/bin/
you could copy xwin somewhere, for example, to /root/my-applications/bin, then a line like this in rc.local would restore your modifed version of xwin every time Puppy boots:
cp -f /root/my-applications/bin/xwin /usr/X11R7/bin/
but if Puppy upgrades and has a newer version of xwin, the newer xwin will be replaced by your modifed version ... you could cp the file only if the puppyversion is still 212:
grep -q 212 /etc/puppyversion && cp -f /root/my-applications/bin/xwin /usr/X11R7/bin/
Re: File Restore
ecomoney, you're running the Puppy 1.xx series - IIRC, only the /etc directory was saved to pup001 (as /root/.etc I think it was), so yes the changes are lost.ecomoney wrote: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?
Did you ever try my suggested mod to make xwin always start even after a crash? (sixth post, first page of this thread) That mod is saved in /etc/profile and will be written to pup_001. The mod worked when I tested it
Methinks Raspberry Pi were ideal for runnin' Puppy Linux
in Puppy 1.x, /usr is writable (the changes are saved in /root/.usr) ... but Puppy 1.x does not have /usr/X11R7/bin/, Puppy 1.x uses X11R6
i think that either you are running Puppy 2.x or you have an X11R7 directory that does not belong in Puppy 1.x ... i think changes made to X11R7 will be saved, but that the changes will not affect Puppy at all
if you have Puppy 1.x, xwin is in /usr/X11R6/bin/
in Puppy 2.x, xwin is in /usr/X11R7/bin/
i think that either you are running Puppy 2.x or you have an X11R7 directory that does not belong in Puppy 1.x ... i think changes made to X11R7 will be saved, but that the changes will not affect Puppy at all
if you have Puppy 1.x, xwin is in /usr/X11R6/bin/
in Puppy 2.x, xwin is in /usr/X11R7/bin/
pakt's method:
http://murga-linux.com/puppy/viewtopic. ... 0698#80698
should work for any version of Puppy
if you upgrade Puppy, /etc/profile will probably be replaced by a new /etc/profile file, so it might be better to put the line in /etc/profile.local, or /etc/rc.d/rc/local ... those files should not be changed by an upgrade
http://murga-linux.com/puppy/viewtopic. ... 0698#80698
should work for any version of Puppy
if you upgrade Puppy, /etc/profile will probably be replaced by a new /etc/profile file, so it might be better to put the line in /etc/profile.local, or /etc/rc.d/rc/local ... those files should not be changed by an upgrade