Make Puppy recover automatically from improper shutdowns

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

Why not full installation, people?

#46 Post by SilverPuppy »

I do understand the portable environment benefits of Puppy, but that said, why wouldn't you just do a full install on a small partition in this situation? Then you can use my files and have recovery fully automated, and everything wonderful!

Not only can it automatically fix the problems idiots introduce by dumping computers in a heap instead of turning them off nicely, but you also experience the following benefits running full vs. frugal:

1. The SFS system uses RAM, as everything else does. Running off a LiveCD I've observed as much as 17MB of additional RAM usage compared to a full install.

2. The SFS decompression takes up a significant amount of CPU time on low-powered computers. Running full installations removes this load as well.

I would recommend using EXT3 when you do, as the journaling makes it easier for fsck to fix things, but that's just a fringe benefit. :D

sindi
Posts: 1087
Joined: Sun 16 Aug 2009, 13:30
Location: Ann Arbor MI USA

Fixed inode count problem Puppy 4.31 frugal

#47 Post by sindi »

I kept running e2fsck on pupsave.2fs and new errors kept developing. Copied the files from one 2 GB hard disk without UDMA support to a slightly newer one with UDMA support which runs twice as fast. No more errors. Normally frugal install can recover from improper shutdown. I had too many unfixable crashes with full install that e2fsck could not fix.

Only the pupsave.2fs file ever got the bad inodes so I ignored it and started fresh. DOS works okay on that drive. Puppy works on a 400MB drive without UDMA.

With 256MB RAM, I don't worry about losing 17MB of it. Puppy does run faster from memory than from hard disk on older computers (at 300MHz it was up to 5 sec between click and program appearing on screen). The full install appears not to load into RAM.

DarinB
Posts: 24
Joined: Wed 30 Dec 2009, 19:44

#48 Post by DarinB »

I am using a full install. of 431 please explain how to use your files. i had a couple of bad shut downs but after typing reboot it came back, i am a newbie to this and don't know if i am using ext 2 or ext 3 and if that matters. Since this is an old p3 256mb ram lap top with a dead motherboard bat and pc bat i use the power cord that sometime falls off. BUT with pup this thing is really fast and i love it.

nassausky
Posts: 26
Joined: Sun 08 Jun 2008, 03:59

#49 Post by nassausky »

This thread has been very interesting. Thanks for the interesting scripts you pieced together. I actually had a problem this sunday. I was running terminal in a secure session and decided to reboot puppy 4.31 by using the 'reboot' command. Waited a while and never regained ssh control of the puppy linux box remotely. Showed up at the client and it was stuck at the root prompt #. The USB Keyboard wasn't working. Wound up reinstalling Puppy 4.31. It happened again this afternoon. I thought it was a rare situation until I typed 'reboot' again and it seems that it doesn't cleanly reboot the computer. Anyhow my question is if I plug in a PS/2 keyboard and I have access to the root prompt. Can I just install the 4.31 files into the /etc/rc.d folder and change their permissions and run it after whatever damage was done to the file system or is it too late already and should I reinstall puppy again for the 2nd time.

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#50 Post by pri »

SilverPuppy :
the script is work on 4.3.1, but there is a new problem. i must set up mouse every boot.
Learning by Doing

nassausky
Posts: 26
Joined: Sun 08 Jun 2008, 03:59

#51 Post by nassausky »

So far one test run of the script on a virtualbox machine with Puppy 4.31 the script didn't restart the GUI. It was able to sense the irregular shutdown and rebooted a 2nd time and ran a file check but then it returned to the root prompt#

tmay
Posts: 3
Joined: Sat 06 Feb 2010, 00:09

#52 Post by tmay »

Hello all this is my first post on this site. I have found your topic to be very interresting and have attempted to follow along. but have been unsuccessful. I have a old gateway 700c that i have been fixing for my daughter and would really like to get this to work. any help would be appreciated. I have backed my original files and have even altered them to match yours silverpuppy. but am unable to boot off hard drive. I am using puppy 4.3.1. thanks in advance

nassausky
Posts: 26
Joined: Sun 08 Jun 2008, 03:59

#53 Post by nassausky »

Just a note again for newcomers... This is for a Full Install not a Frugal Install and the scripts have to be chmod 755 to get them to execute. It seems on my test runs it's sporatic and works some of the time. Has anyone tested it a few times?

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#54 Post by pri »

i tested, but have problem always ask seting mouse every boot.
Learning by Doing

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

Sounds like a classic case of.....

#55 Post by SilverPuppy »

OOPS! :D

I think your mouse problem is that you picked the wrong rc set. If you put the 4.1 set with 4.3, there's no telling what will happen. At the least, it will act more like 4.1.

As for working intermittently, I have never had problems with that. Properly configured, this works every time. I have dumped test machines several times, and they always recovered to a happy X.

That said, my test machines were all real.....I have no idea what will happen in a virtual machine. Use at your own risk there.

Tmay who can't boot: did you load grub properly? Did it boot before you changed the files out? Did you use the correct set of files? You'll have to be MUCH more specific about the behavior you're getting if we're to be able to help.

Nassausky, I have noticed that if you type reboot in a terminal on Puppy, it will throw a fit. I've only ever tried it in a local RXVT, but I'd imagine that it might do the same thing when you're logged in with telnet-ish (I presume that's what you did, sorry, I'm still rather addicted to doze....) ....I'd presume that you can just dump the files in and boot it for repair, but do note that you'll have to do 2 things: verify that the partition matches in the e2fsck line, and create a file called /tmp/RUNNING (can be empty) so that it realizes that it was improperly shut down.

Hope that helps....believe it or not, I'm actually somewhat new to Linux, but I understand the way it thinks pretty well because of my childhood DOS and BASIC life. :lol:

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

Please review.....

#56 Post by SilverPuppy »

DarinB wrote:I am using a full install. of 431 please explain how to use your files. i had a couple of bad shut downs but after typing reboot it came back, i am a newbie to this and don't know if i am using ext 2 or ext 3 and if that matters. Since this is an old p3 256mb ram lap top with a dead motherboard bat and pc bat i use the power cord that sometime falls off. BUT with pup this thing is really fast and i love it.
EXT2 or EXT3 doesn't strictly matter, but in your situation I suggest EXT3 because the journaling makes it a bit more forgiving, albeit it does give you slightly less usable space and slightly worse write performance.

If you start at the top and read down, I think you'll understand deployment pretty well.

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

RAM it?

#57 Post by SilverPuppy »

sindi wrote:With 256MB RAM, I don't worry about losing 17MB of it. Puppy does run faster from memory than from hard disk on older computers (at 300MHz it was up to 5 sec between click and program appearing on screen). The full install appears not to load into RAM.
You're right, it doesn't. I prefer that behavior. I don't see the sense either of storing the entire OS and the core apps in RAM all the time, or of constantly compressing and decompressing stuff to make that possible. It does slow things down, and very noticeably on old original Pentium machines that are a bit more CPU-cycle starved.

But to each their own. That's Linux for you! :D

nav2k4
Posts: 1
Joined: Fri 12 Feb 2010, 22:02

Power Failure

#58 Post by nav2k4 »

Hey guys,

I am trying to use puppy 4.3.1 as a terminal services (RDP) client. I am using the PCTSCscripts to accomplish this.

The problem is that when ever a user resets the computer or there is a power failure it loops trying to start X. I have tried the methods suggested in this thread and various other threads on this forums but it still seems to be broken.

Here is a list of files that I have edited:

rc.sysinit

Code: Select all

busybox mount -t proc none /proc ;STATUS=$((STATUS+$?))
if [ -f /RUNNING ];then
echo -n "(Checking Filesystem..)" >/dev/console
 e2fsck -p -f /dev/sda1 &
 wait
fi
if [ ! -d /initrd ];then #w468
 busybox mount -o remount,rw /
 echo 'PUPMODE=2' > /etc/rc.d/PUPSTATE
fi
. /etc/rc.d/PUPSTATE #variables created at bootup by init script in initrd.

#v409 mount/umount scripts no longer write to /etc/mtab, as gparted failed to create a
#ext3 partition -- dunno why. Instead, now have /etc/mtab a symlink to /proc/mounts...
rm -f /etc/mtab
ln -s /proc/mounts /etc/mtab
#-------------------------------------------------------------------------------------------------
##############SHUTDOWN RECOVERY Add to /etc/rc.d/rc.sysinit################
#If we were not shutdown cleanly, try and recover
if [ -f /RUNNING ];then
 echo -n "(Cleaning up after Unclean SHUTDOWN)" >/dev/console
 rm -f /var/log/X*
 rm -f /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
 rm -f /etc/.XLOADED
fi

###################Detect Bad Shut######################
#create a file in tmp that should be deleted on a clean shutdown
if [ ! -f /RUNNING ];then
 echo 'this file is deleted during a clean shutdown' > /RUNNING
fi 
#-------------------------------------------------------------------------------------------------

#redirect all output to a log file (must do after remount rw)...
[ ! "$LOGLEVEL" ] && exec 1>/tmp/bootsysinit.log 2>&1

rc.shutdown

Code: Select all

echo "${DISTRO_NAME} is now shutting down..." > /dev/console
#------------------------------------------------------------
rm -f /RUNNING
echo "Puppy is deleting RUNNING..." > /dev/console
#------------------------------------------------------------
ORIGPUPMODE=$PUPMODE #v2.22
I have attached the file that pctsc uses to call pctsc.auto.tsc which runs rdesktop.

Any help solving the power issue will be greatly appreciated :)

EDIT: Oh and the filesystem im using is ext3, full-HD install
Attachments
root.zip
(2.37 KiB) Downloaded 408 times

arcadeko
Posts: 14
Joined: Fri 12 Feb 2010, 21:04

USB Flash Drive recovery not an issue?

#59 Post by arcadeko »

I installed puppy on a flash drive using the installer at

http://www.pendrivelinux.com/install-pu ... m-windows/

posted this http://www.murga-linux.com/puppy/viewtopic.php?t=52455

then spent the past hour reading every post in this thread :D

- Since I am a total Puppy noob and only learned about it yesterday :X I donn't know if I am going to have an issue with using the 4GB USB drive as the ONLY drive for the computer. I have it all booting up fine and I even yanked the cord a few times just to see if it would fail on resume -
I guess I tested it about 3 times and no problems, but then I read this thread and now I am worried again.

Do I need to install a script to run fsck on the flash drive? is that even possible?

I am guessing its a Frugal install (since its for a pendrive and I had to install the dev-XXX-.sts thingy manually to compile C code) and since Wikipedia says flash memory doesn't usually (can't maybe?) use journaling, I am guessing I am using ext2 not ext3...

I want to use this as the system for a arcade cabinet running puppy arcade - the machine will invarably get unplugged often, do I risk turning my arcade cabinet into a 150 lb paperweight until I hook up a CD drive and try to reinstall? :shock:

man, reading more just creates more questions.. head hurt, must stop now...

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#60 Post by pri »

hei... great.....

look like i was wrong download.... :lol: :lol:

thk now i included on mu puppy remastered
Learning by Doing

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#61 Post by pri »

:mrgreen: :mrgreen:

sory.. i am come back again ........

is the script just for ext2 ? because when using ext3 its not work, and stoped in prompt.

:roll:
Learning by Doing

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

EXT3 is fine

#62 Post by SilverPuppy »

Well, I haven't used this on anything BUT EXT3 recently, and it works fine. Just be sure you've got the partition set properly in the e2fsck line, and are using the correct scripts.

Even if the e2fsck line is messed up, it should still generally work. I'm not sure where you made a wrong turn.

User avatar
Colonel Panic
Posts: 2171
Joined: Sat 16 Sep 2006, 11:09

#63 Post by Colonel Panic »

Thanks for this Silverpuppy. I've downloaded these scripts and plan to install them on a computer at my local community centre which has EcoPup and Puppy 4.21 installed on it.
Gigabyte M68MT-52P motherboard, AMD Athlon II X4 630, 5.8 GB of DDR3 RAM and a 250 GB Hitachi hard drive running Ubuntu 16.04.6, MX-19.2, Peppermint 10, PCLinuxOS 20.02, LXLE 18.04.3, Pardus 19.2, exGENT 200119, Bionic Pup 8.0 and Xenial CE 7.5 XL.

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

Great stuff!

#64 Post by SilverPuppy »

Just be certain to insert my pieces into the 4.21 files so you don't end up with weird behavior because something isn't right.

Search for my username "SilverPuppy" to find the pieces I've added.

jockjunior
Posts: 150
Joined: Tue 29 Jan 2008, 21:11
Location: Lancashire,U.K.
Contact:

#65 Post by jockjunior »

Thanks for files Silverpuppy. Just what I needed for 4.3.1

much obliged

Jock :D

Post Reply