 |
Puppy Linux Discussion Forum Puppy home page: puppylinux.com
|
The time now is Thu 29 Jul 2010, 13:18
All times are UTC - 4 |
| Author |
Message |
Abhay
Joined: 09 Dec 2009 Posts: 23
|
Posted: Thu 07 Jan 2010, 14:44 Post_subject:
Autorecover from sudden shutdown Sub_title: editting of rc.sysinit script |
|
Hello everyone,
this topic of puppy not being able to recover properly from sudden power failures or shutdowns has been there in t forums for a while, i wonder though why t correction hasn't yet been made in t original boot scripts..
Anyways, I have a full-hd installation of puppy linux 4.3 on my comp, and i too faced this problem of puppy not starting after a sudden shutdown.. Agreed, it can be solved by after browsing through t forum but it is quite a task, n one will probably end up reinstalling, like i did.. t problem that occured on my comp was similar to the one found in this thread:
http://www.murga-linux.com/puppy/viewtopic.php?t=36944
It has problems loading usb modules, then enters into a black screen with '#'
Then, after typing "xwin" t gui starts, but usb devices are not recognized unless i do a proper restart (type "poweroff" or "reboot" at t command prompt/ black screen which u r taken to when started after sudden shutdown)
And finally, with help from various posts in t forum, i could get t following script to solve t problem:
I thought i'll post this on t forum, cos this problem of puppy not starting properly after sudden shutdown might make new users to puppy run away..
| Code: |
############ clean-shutdown-detect ##############
#Detect and clean improper shutdown
if [ -f /tmp/RUNNING ];then
echo -n "Cleaning up after Improper Shutdown...." >/dev/console
rm -f /var/log/X*
rm -f /tmp/RUNNING
rm -rf /tmp/*
rm -f /var/lock/LCK*
rm -f /var/run/*.pid
rm -rf /root/tmp 2>/dev/null
rm -rf /root/.thumbnails/* 2>/dev/null
[ -f /etc/rc.d/MORESFS ] && rm /etc/rc.d/MORESFS
status_func 0
fi
#Create a file in tmp that should be deleted on a clean shutdown
if [ ! -f /tmp/RUNNING ];then
echo "This file is deleted during a clean shutdown." > /tmp/RUNNING
fi
########## end-clean-shutdown-detect #############
|
I added these lines to t rc.sysinit script in t /etc/rc.d folder after t "Making filesystem usabel" part, i.e. just above t line
############VERSION UPDATE#############
So, basically, as we see in t above script, there are a few temporary files which are deleted during a clean shutdown, so this script will check for a clean shutdown, and if that wasn't t case, it'll delete those temporary files and proceed with t startup..
Now i can, without any problems, recover puppy from a sudden shutdown on my computer.. (note: mine is a full hd install, i've not tried on frugal installs)
I have also attached t rc.sysinit file with this post.. If someone else also faces similar problems, one can replace t rc.sysinit file in /etc/rc.d/ folder with this one, make sure to keep a backup of t orignal script though, just in case.. Also make sure t file has executable permission, i.e. after copying t file into /etc/rc.d/ type in terminal:
| Code: | | chmod +x /etc/rc.d/rc.sysinit |
to enable t executable permission..
Also, i found another post on t forum by silverpuppy related to this topic, might be useful, the link is:
http://www.murga-linux.com/puppy/viewtopic.php?t=47668
pls provide feedback if this was useful, thank you..
| Description |
This file, rc.sysinit, has to be placed in /etc/rc.d/ folder, replacing t original file..
|

Download |
| Filename |
rc.sysinit.tar.gz |
| Filesize |
7.92 KB |
| Downloaded |
106 Time(s) |
|
|
Back to top
|
|
 |
pacmanfourtwenty
Joined: 18 May 2010 Posts: 1
|
Posted: Tue 18 May 2010, 09:29 Post_subject:
|
|
i know this is a older post but i wanted to say thanks this worked great for me i'm running pup 4.2
|
|
Back to top
|
|
 |
|
|
|
Rules_post_cannot Rules_reply_cannot Rules_edit_cannot Rules_delete_cannot Rules_vote_cannot You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|