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

As I said before......

#16 Post by SilverPuppy »

Have it your way! :D We love Puppy!

While I won't ever use Puppy the way you do, I respect that your uses for Puppy are quite as legitimate as mine, and if it works best for you that way, so be it!

That's the joy of Linux--make it what you want it to be, not what M$ thinks you should have!

PupGeek
Posts: 353
Joined: Sun 06 Sep 2009, 11:30

#17 Post by PupGeek »

exactly

Puppyt
Posts: 907
Joined: Fri 09 May 2008, 23:37
Location: Moorooka, Queensland
Contact:

#18 Post by Puppyt »

Bloody Brilliant, SilverPuppy.

Love this - just skimmed your posts with Sylvander and co (and have kinda been hovering around mikeb's posts on various other threads, taking notes etc - glad to see his hand in this). Your methods here appear to be just the the tonic for another related scenario - old hardware and a shortage of RAM causing problems with incomplete shutdowns. I've gone "Full" with my installations in a sub-64Mb setup, barebones 4.1.2, Ext2, but the 'structure' keeps unraveling and it bogs down after a few shutdowns... Thought I'd be noobie-smart and take the shortcut with "pfix=fsck" in the Grub menu.lst, but apparently that argument has been functionally removed from the 4.1 series and I don't have the patience now to spend on the other recommended workarounds. You've convinced me - I'm going retro (should've started there), and ext3. With your pet.

A real gem - Thankyou!

=====================================
SilverPuppy's Digital Diaper for Dilapidated Desktops

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#19 Post by mikeb »

Thought I'd be noobie-smart and take the shortcut with "pfix=fsck" in the Grub menu.lst,
that only applies to frugal setups and only checks the pup_save and not the partition.

Hope this package helps....I have an old kayak and these fixes make for a reliable full install .

mike

PupGeek
Posts: 353
Joined: Sun 06 Sep 2009, 11:30

#20 Post by PupGeek »

yeah but couldn't you boot a live cd session and run fsck from there do scan your hard drive?

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#21 Post by mikeb »

yeah but couldn't you boot a live cd session and run fsck from there do scan your hard drive?
indeed...good technique for beginners.

Windows shuts down cleanly and when there is a bad shutdown a file system check is done...all automatically and has done for years. Should not puppy try and at least match this standard of functionality?
What if the full install is on a laptop with no CD drive...not so convenient to play techie recovery.

I'm glad that I no longer have to intervene when the family press the power button by mistake or there is a power cut.

mike

Puppyt
Posts: 907
Joined: Fri 09 May 2008, 23:37
Location: Moorooka, Queensland
Contact:

#22 Post by Puppyt »

Thanks Again, SilverPuppy and mikeb -
I full-installed 4.1.2 barebones Retro on a small hard-drive, 2.4GHz CPU and 1.25Gb RAM. Put in the patches (wallpaper setter and screen lock), and trimmed the background running processes etc etc for later transfer into a sub-64Mb laptop. And then I installed your modded scripts and gave it some rude power-downs and it worked! Kinda...
Perhaps it is something to do with my hardware (ASUS P4S800-MX motherboard), although I don't imagine so - but very few official puppies or puplets enable me to either shut down completely or reboot properly, with hangs on "Power down" or "System restarting" messages. In the case of the 4.1.2bbRetro, it's the reboot that flunks - and I get corresponding resumption errors using your corrected scripts when responding to rude power-downs. Perhaps you should make a caveat to your users that for best results they ensure that shutdowns and restarts work under normal circumstances first?
Sorry to regress like this - I'm one of those fringe-dwelling Linux dabblers and I haven't yet bothered to work out why I get those "closure" problems - I just move onto another flavour of Puppy. TeenPup and HSB have been standouts with closure and resumption procedures on any machine I run them on (perhaps I should nick their scripts...),

Cheers.

EDIT: Just found a whole heap of threads with this behaviour attributed to various bios / apm /acpi settings. Curious that there doesn't seem to be shutdown standardization or consistency between puppy versions and puplets.

PupGeek
Posts: 353
Joined: Sun 06 Sep 2009, 11:30

#23 Post by PupGeek »

mikeb wrote:Windows shuts down cleanly and when there is a bad shutdown a file system check is done...all automatically and has done for years. Should not puppy try and at least match this standard of functionality?
Actually mike, you have a good point there.... Dyne Bolic does that so I know it can be done in linux. My previous hard install of Dreamlinux(debian) did that as well.

DemostiX
Posts: 46
Joined: Fri 24 Apr 2009, 15:17

#24 Post by DemostiX »

Please be explicit about where these files should go, what they replace, if any, and where to look for output to see the actions have acted as expected and desired. I'd like more optional control of startup and shutdown from Puppy, here with 4.31., run from ext2 partition on a USB pen drive, so these are welcome. I missed, for example the loss of startup options from the USB drive in 4.31, until I found a recent post on restoring them.

Not afraid to ask, as this was found under "HOWTO" , as against for Developers.

Fiestita
Posts: 8
Joined: Sun 22 Nov 2009, 17:40

#25 Post by Fiestita »

Hello, I'm Juan Manuel, from Argentina. I've been in computing since a child and this year started learning programming.

Last month ended up messed up to the medule with windows xp. The thing is that, as one of my home computers is for family use, and as my relatives aren't very clever avoiding malaware, I always ended with format c: command xDDD

Tired of so, though about trying that C based SO called linux. Downloaded about 20 distros for a very light PC (P3 coppermine 700 @ 811 + 512 mb ram + 3dfx voodoo 5 5500) and the one that suited perfetc because of it effectiveness, quickness and user friendlyness is puppy. But ended up witch quite a trouble with impropper shutdowns.

Angry, believed that there wasn't a fix for it, until... my head told me: - "fool, there must be a forum!!!".

And there actually were a forum.

I use lastest puppy release, and rc.files from 4.1.2 and 4.3.1 differs, so I manage after some failed attempts to get rc.sysinit and rc.shutdown working propperly for 4.3.1 and I want to share this to other people who may be aren't able to understand rc.files coding

On the other hand, is there a way to make puppy auto-reboot after the xorg start that we get when we clean up after improper shutdown?

that way, the process will be fully automatic, I know, I'm just too lazy, but it would be great to push power button and go to bath, and when coming back, puppy is working perfectly xDD

EDIT: I think we may create a flag, after e2fsck...

set to "1", and when we got xorg up, the flag as "1" get it to reboot, and in that reboot, we change flag to "0".

In that way, puppy would restart every time xorg gets to work after e2fsck and would not, after that restart...

The thing is that as I'm a newbie for puppy, I can't figure how to make this...
Attachments
puppyfiles341.tar
(70 KiB) Downloaded 809 times

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

It does.....

#26 Post by SilverPuppy »

If you integrate my mods into the 4.3.1 files EXACTLY, it will do exactly as you wish: clean up, reboot to avoid X problems, FSCK, and run perfectly normally.

Try my files on 4.1.2 and see how they behave, and I think you'll like it. Then just search for my username "silverpuppy" to find the things I added so you can copy them to your .rc files.

PupGeek
Posts: 353
Joined: Sun 06 Sep 2009, 11:30

Re: It does.....

#27 Post by PupGeek »

SilverPuppy wrote:If you integrate my mods into the 4.3.1 files EXACTLY, it will do exactly as you wish: clean up, reboot to avoid X problems, FSCK, and run perfectly normally.

Try my files on 4.1.2 and see how they behave, and I think you'll like it. Then just search for my username "silverpuppy" to find the things I added so you can copy them to your .rc files.
Why not spin a remaster of it as you modded it? Come to think of it, a puplet with a name based on "silverpuppy" would sound pretty cool too.

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

Interesting......

#28 Post by SilverPuppy »

Well, that's an idea, but the one major issue I see with it is that this is not meant to help on a LiveCD, but on a full HD install. I'd rather just provide modded files for the different versions, but there's too many. The instructions should be fairly clear on how to implement my mods, and if someone wants help with a specific version, I'll help through the forum.

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#29 Post by ecomoney »

Great work Silverpuppy, I will be including this in my installs. Feedback from the field is always appreciated. BarryK should definetely be made aware of this as puppy 4 series is a pain for not restarting properly after a powercut, has anyone made him aware yet? I got caught with this the other day in a meeting with my business adviser when the power failed on my laptop...it didnt look good :cry:

Ive also noticed, with frugal installs, errors to do with "Stale NFS file handles" occur with 4 series puppy. Does this/would this solve these problems?
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

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

Not really sure.....

#30 Post by SilverPuppy »

Well, maybe....:D

This is not meant to work with frugal, only with full, BUT with some tweaking might be usable for frugal as well. I don't usually use frugal installs, as I usually make it the primary OS. I'm afraid I'll not be much help on frugal installs.

The "stale NFS file handle" problem is fixed by the FSCK that is triggered after an improper shutdown. That's the most common real problem that this modification addresses, with the other "problems" being getting dropped at a # prompt (which most of my clientele doesn't know what to do with) and requiring a reboot before USB will work correctly after an improper shutdown.

In a frugal install, perhaps your best shot would be to boot with the pfix=fsck option.....I don't know if it could be done any other way with a frugal installation, because the handle for the "drive" is not quite so concrete as /dev/sda1 for example.

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

You pm-ed me.....

#31 Post by SilverPuppy »

rameshiyer wrote:I am using 4.3.1 full installation with Ext4 ( dual boot). I am not able to boot after power loss or improper shutdown. Kindly provide solution or pet package to install so that I can reboot my puppy with reinstall the same. I have read your postings int his regard, however, I am not able to follow the postings. Kindly help me in this regard.
Well, if you can't boot, then your first course of action is to boot from a LiveCD and run fsck on the partition that Puppy lives on (probably sda2 in your case, but do verify this)

Once you get things running again, check out my original post for new files I just made yesterday for 4.3.1----they work the same as the ones for 4.1.2, (drop-in to /etc/rc.d, then change the line in rc.sysinit that says "fsck /dev/sda1" to reflect whatever the partition Puppy lives on is called, then reboot) with one additional caveat: the TIME ZONE MUST BE SET TO GREENWICH, or fsck reports that the superblock last write time is in the future, and won't run automatically (might only apply for the first few hours after installation, come to think of it.)

Anybody want to comment on the superblock/Greenwich issue? Thinking about it now, I guess it shouldn't matter in general, only for the first few hours after installation, as IIRC the superblock is not written to otherwise.....or am I mistaken?

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#32 Post by mikeb »

I have yet to achieve a clean shutdown with frugal and the clean up script is in initrd.gz anyway. Inability to unmount from the union is the cause although slax manages this :D .

As I mentioned before puppy 4 unreliability is mainly due to useng ext2 for the pup_save...I don't get problems like this with puppy 2 which uses ext3... a tweak of the init script needed for that change . Alternatively add pfix=fsck to the kernel boot line.
If unionfs is used whiteout files do accumulate and eventually cause problems...aufs does not seem to suffer this.

Full installs are not supported as its not considered the approved way of using puppy so its up to us to provide the fixes.

mike

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

Unapproved and improving it

#33 Post by SilverPuppy »

Well, I aim to make that "unapproved" use much more usable! :D

As for unmounting from the union......the Southern States managed to SECEDE from the Union.....so how hard can a simple unmount be? :lol:

Why on earth does the Universal Installer make it so easy then, if it's not the "approved" way? Perhaps because Puppy is OSS, and doesn't need anybody's approval? :P

User avatar
enhu
Posts: 302
Joined: Wed 27 May 2009, 02:13
Contact:

#34 Post by enhu »

what shall i do with this rc.sysinit&shutdown-4.1.2-4.3.1.zip?
i download it, unzip it and saw some files.

havent understand puppy yet until now.

should i put it inside rc.d?

G0XAN
Posts: 31
Joined: Fri 08 May 2009, 18:52
Location: Brighton, UK

#35 Post by G0XAN »

enhu

First, go to /etc/rc.d and rename the existing rc.sysinit and rc.shutdown or move them into another directory so they are kept safe.

Next you have to choose which version of the files you need - 4.1.2 or 4.3.1
Extract the files you need and rename them to rc.sysinit and rc.shutdown (remove the version numbers)
Now copy (or move) the new rc.sysinit and rc.shutdown into /etc/rc.d
Finally, change the permissions on the files so they can execute

Code: Select all

chmod 755 rc.sysinit
chmod 755 rc.shutdown
And that's it, you should be good to go.

Silverpuppy, can I suggest you add the instruction on where to put the files into the first post with the files, or maybe a brief readme in the zip file.
Excellent work BTW, just what I was looking for. :) Thanks!

(Edit: Added in the chmod instruction, as I fell foul of it myself!)
Gary

Post Reply