Clean shutdown for full installs

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

Clean shutdown for full installs

#1 Post by mikeb »

Want a clean shutdown with a full install and not getting it?

try adding this line just before the last umount in /etc/rc.d/rc.shutdown:

Code: Select all

killall `fuser -v -m / 2>&1 | grep F | grep -v rc.shutdown | grep -v reboot | grep -v grep | grep -v poweroff | awk '{print $4}'` 
all one line. Tested with puppy 2.12 and 4.12.
Probably could be incorporated with the frugal cleanup section (which is next on my agenda..a few dirty bibs there too)

Using ext3 masks unclean shutdowns as it cleans up when it is mounted but another distro running fsck will show the dirty flag and IFS on windows won't mount because of it.

mike

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

4.3 beta 1 multisession DVD is not shutting off the power after saving. Do you think this would fix that?
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69321][color=blue]Puppy Help 101 - an interactive tutorial for Lupu 5.25[/color][/url]

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

#3 Post by mikeb »

4.3 beta 1 multisession DVD is not shutting off the power after saving. Do you think this would fix that?
no sounds like an acpi problem...may try acpi=force boot parameter...the cut of date may have been changed....

This simply tries to make sure partitions are unmounted/remounted read only before poweroff...if they are not it would poweroff regardless.

mike

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#4 Post by Flash »

OK, thanks.

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Re: Clean shutdown for full installs

#5 Post by gyro »

mikeb wrote:Probably could be incorporated with the frugal cleanup section (which is next on my agenda..a few dirty bibs there too)
Mikeb,

I'm really looking forward to your fix to rc.shutdown so that frugal installs do a clean shutdown.

I've tried adding your code to my rc.shutdown (puppy 4.1.2 frugal) but I still get pup_save.3fs not cleanly umounted.

I've also tried to fix rc.shutdown myself, but with no sucess.

gyro

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

#6 Post by mikeb »

There is a section that checks it is frugal and that is where processes should be killed. Also there is the mounting of the pup_save and mounting of where the pup_save is so a mount within a mount to deal with.

Someone recently was changing the boot parameter to pmedia=usbflash to make a hard drive frugal install behave as a usb flash stick and that seemed to help...might be worth experimenting with.(with backups made of course :) )

Been a bit busy recently but with dive into this soon.

mike

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#7 Post by gyro »

mikeb wrote:Someone recently was changing the boot parameter to pmedia=usbflash to make a hard drive frugal install behave as a usb flash stick and that seemed to help...might be worth experimenting with.(with backups made of course :) )
Yes, that is me.
Seems to work too (in Puppy 4.3.0), just a little slower shutting down.

gyro

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

#8 Post by mikeb »

Ah ha...I tried to find the thread.
Does doing that actually give a clean shutdown?.....i lose track on this forum sometimes :D

mike

aarf

#9 Post by aarf »

gyro wrote:
mikeb wrote:Someone recently was changing the boot parameter to pmedia=usbflash to make a hard drive frugal install behave as a usb flash stick and that seemed to help...might be worth experimenting with.(with backups made of course :) )
Yes, that is me.
Seems to work too (in Puppy 4.3.0), just a little slower shutting down.

gyro
tried to use pmedia=usbflash on my SSD frugal install of 430. failed to boot . sfs not found.

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

#10 Post by mikeb »

tried to use pmedia=usbflash on my SSD frugal install of 430. failed to boot . sfs not found.
hmm perhaps it's a bit of a fluke that this works for gyro.
What is really needed is forcing of pupmode to 13

mike

[MOB]Trip
Posts: 31
Joined: Wed 07 Oct 2009, 07:43
Location: same shit world u live in.
Contact:

#11 Post by [MOB]Trip »

define clean shutdown :oops:
im on dingo 4.0 full install...i shutdown...it sigterm kills all blah blah..then "requesting system power off" Power down..i hear the hd kick off...but pc dont shut off...i hold power button..solved... so this would prevent me from usen meh big toe on the power button? :twisted:
[img]http://i850.photobucket.com/albums/ab63/Prezzle/triptest.gif[/img]
[img]http://i551.photobucket.com/albums/ii476/Mazine999/mobbu7.gif[/img]

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

#12 Post by mikeb »

define clean shutdown
that sounds like you need 'acpi=force' as a boot parameter to save yer big toe.

This is about when puppy shuts down it does not unmount drives properly so leaves the dirty flag set so on a restart the file system has to be checked/cleaned up....it's doesn't usually mean any corruption but can be inconvenient.

mike

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#13 Post by gyro »

mikeb wrote:hmm perhaps it's a bit of a fluke that this works for gyro.
Sorry I didn't read your post closely enough.

Code: Select all

pmedia=ataflash
is what works for me, in a frugal install using files from pup-430.iso.

gyro

aarf

#14 Post by aarf »

gyro wrote:
mikeb wrote:hmm perhaps it's a bit of a fluke that this works for gyro.
Sorry I didn't read your post closely enough.

Code: Select all

pmedia=ataflash
is what works for me, in a frugal install using files from pup-430.iso.

gyro
pmedia=ataflash put into menu.lst.
boots.
will monitor it for any improvement in shutdown.

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

#15 Post by mikeb »

pmedia=ataflash
ahhhhhhhhhhh :oops: my bad...that makes sense :D ...meant for cf flash drives I presume.

I will give this a tryout too....been a busy bunny recently.
I find this mode interesting as working files are still in ram so should provide for a speedup and it also means temporary files created during a session are not needlessly saved....the only proviso is a decent amount of ram though in my head this method effectively increases virtual filespace...ie pup_save + tmpfs.

regards

mike

[MOB]Trip
Posts: 31
Joined: Wed 07 Oct 2009, 07:43
Location: same shit world u live in.
Contact:

#16 Post by [MOB]Trip »

mikeb wrote:
define clean shutdown
that sounds like you need 'acpi=force' as a boot parameter to save yer big toe.

This is about when puppy shuts down it does not unmount drives properly so leaves the dirty flag set so on a restart the file system has to be checked/cleaned up....it's doesn't usually mean any corruption but can be inconvenient.

mike
and where would i put this acpi=force ehh?
and it appears to shutdown correctly...just doesnt shut the hell off afterwards.
[img]http://i850.photobucket.com/albums/ab63/Prezzle/triptest.gif[/img]
[img]http://i551.photobucket.com/albums/ii476/Mazine999/mobbu7.gif[/img]

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

#17 Post by mikeb »

Well if installed to the hard drive it would be on the kernel boot line in menu.lst which is in /boot...somewhere.....

something like

kernel /vmlinuz acpi=force .......

mike

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

#18 Post by mikeb »

Ok tries ataflash (and ideflash) on frugal puppy 4.12 but it remained in pupmode 12.
I did try on puppy 2.12 with ideflash and that did change to pupmode13.

One thing I just remembered is that as standard you cannot delete (hide) files from the original sfs in this mode. I did alter snapmergepuppy to correct this but there is still a problem if an original file is deleted and after a reboot it is restored... it remains hidden after the next reboot.
As mentioned before the puppy virtual space went from 256 MB (pup_save) to 1GB..(tmpfs in ram+swap) though of course space to save in remains at 256MB (or whatever the pup_save size is).

I really need to test this on puppy 4. I wonder if having /tmp in ram is affecting things...I have 512MB ram and 500MB swap....I will examine the init script.

mike

edit...of and dev_save is changed to pup_ro1...never knew why...so external links may not work.
was testing 4.12 retro and the init classes ataflash as fast media to will not use pupmode 13

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

#19 Post by mikeb »

Ok been experimenting with puppy 2.12....
I created an initrd.gz that performs an fsck on dev_save at boot.
basically the command line at the start of this topic does kill all apps but unfortunately this does not unlock the unionfs so dev_save remains mounted as rw regardless...pup_save does change to ro
Using ideflash although switching to mode 13 does not alter this behaviour.
So so far I have not found a means of performing a clean shutdown with a frugal install.

Now puppy 4 uses lazy unmount so next I must test this....

mike

nah 4.12 fails the acid test too....ideas welcome

mike

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

#20 Post by davids45 »

G'day [MOB]Trip
I fixed my shut-off problem by adding "power_off=1" to line 247 of 4.3's rc.sysinit (in /etc/rc.d).
There's a recent forum post that explains how this fix was found and works - please 'search' for this post as I am not able to give you the exact link from this computer I'm on at the moment.
David S.

Post Reply