Ultra Fast Shutdown

Using applications, configuring, problems
Message
Author
User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#21 Post by MochiMoppel »

jrb wrote:don't have a pupsave file but use this

Code: Select all

sed -i 's|PUPMODE=5|PUPMODE=12|' /etc/rc.d/PUPSTATE
in a script in /etc/init.d/. It's in my custom built adrive with PHATslacko5502.
Basically a good idea, but I wouldn't bother with customization or with copying scripts to /etc/init.d/. You would also have to make sure that the script is not run at startup. Too much trouble. I also suggest to change not only PUPMODE 5 to 12. All users could benefit from a change to PUPMODE 12, well...maybe except those who are running it already.

Putting this all together could look like this

Code: Select all

#!/bin/sh

ANSWER=`Xdialog --item-help  --no-tags --title "$0" --stdout --radiolist "Select shutdown method" 300x200 5 \
"tag1" "Power-off SUPERFAST, No save" "on"  "Does not save anything. Immediately powers off without going through Puppy's various shutdown routines" \
"tag2" "Power-off Normal, No save"    "off" "Normal shutdown, but PUPMODE changed to PUPMODE=12, thus Puppy will not offer to save." \
"tag3" "Power-off Normal"             "off" "Normal shutdown" \
`
EC=$?
if [ $EC = 0 ] ; then # errorcode 0=yes ; 255=close icon , 1=No or ESC key
	case  $ANSWER  in
		tag1)       
			rm /etc/.XLOADED
			exec /bin/busybox poweroff
			;;
		tag2)
			sed -i 's|PUPMODE=[0-9]*|PUPMODE=12|' /etc/rc.d/PUPSTATE
			exec wmpoweroff
			;;            
		tag3)
			exec wmpoweroff
			;;            
		*)           
	esac
fi
exit
There is no timeout here. Xdialog wouldn't return any selected or default tag after timeout, which makes it useless. Even worse: Selecting a tag wouldn't interrupt the timer.
Last edited by MochiMoppel on Mon 14 Oct 2013, 11:57, edited 1 time in total.

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

#22 Post by mikeb »

timeout would only make sense for dialog in the shutdown terminal....
Yes including all modes would make sense.
I am definately in the camp of not doing a busybox shutdown if hard drives or memory sticks are present though saying that in standard puppies the attempts at unmounting drives may not work that well anyway.
Busybox does try and unmount drives I believe but don't quote me on that....rc.shutdown might close down a script or 2 that would otherwise hang onto a drive. Indeed shutting down from wmpoweroff might be neater since that is stopping drive icons too... Perhaps a fast reboot should be added also.

Guess we are all in a hurry :D

and that answer is to your post :) assuming no one else posts first.

Actually for the multisession setup I ended up just hitting the power button instead of 'no' :D

mike

edit... not sure if mentioned but this inherently gives a no save at shutdown option...something commonly requested. Something I always do after a compiling session.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#23 Post by Karl Godt »

Puppy rc.shutdown makes sense .

Hard poweroffs in 90-95% of the cases don't corrupt or mark dirty the filesystem.

But that leaves 5-10% when the Puppy 5 /sbin/init runs a fsck on my full installs .

Also the wiping of /tmp in full installs at shutdown in older Pups is necessary . Newer Pups do it in rc.sysinit .

If you install additional programs it might be necessary to run /etc/init.d/program.script stop to delete .pid files in /var/lock .

At all your Brainstorming is weird too me . 15 seconds time save can be achieved with an axe or ImpExplDev too :lol:
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#24 Post by MochiMoppel »

Karl Godt wrote:Puppy rc.shutdown makes sense .
I think that was the essence of the brainstorming, so why would that be weird?

The point of tweaking the shutdown is not so much the time saving, it's rather the option to
- avoid a mandatory saving to pupsave file (time saving comes as a bonus)
or
- avoid being asked to create a pupsave file (this avoids unnecessary interaction for users who deliberately chose to run without pupsave, don't want one and don't want to be asked again and again).

Users like you who run a full install are not affected anyway. They of course should by all means use the standard shutdown procedure.

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#25 Post by Smithy »

Well I have ended up with a button with a three minute (180 timeout), and an advisory.
Jasper's is a bit too ninja for me for now lol.

Like MochiMochel says, it's a quickie that he made for ram based operation. There does seem to have been an introduction of more and more steps since 3HD to shutdown and create a savefile, with a big yellow look to the boxes. There may be very valid reasons for these.

I still can't find and remove that scary "Don't remove your usbflash drive" dialogue, without breaking the firewall state and network appearance.
Attachments
image-1.png
(165.49 KiB) Downloaded 442 times
fastshutdown1.png
(39.92 KiB) Downloaded 432 times
Last edited by Smithy on Sun 20 Oct 2013, 09:07, edited 2 times in total.

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#26 Post by Ted Dog »

mikeb wrote:timeout would only make sense for dialog in the shutdown terminal....
Yes including all modes would make sense.
I am definately in the camp of not doing a busybox shutdown if hard drives or memory sticks are present though saying that in standard puppies the attempts at unmounting drives may not work that well anyway.
Busybox does try and unmount drives I believe but don't quote me on that....rc.shutdown might close down a script or 2 that would otherwise hang onto a drive. Indeed shutting down from wmpoweroff might be neater since that is stopping drive icons too... Perhaps a fast reboot should be added also.

Guess we are all in a hurry :D

and that answer is to your post :) assuming no one else posts first.

Actually for the multisession setup I ended up just hitting the power button instead of 'no' :D

mike

edit... not sure if mentioned but this inherently gives a no save at shutdown option...something commonly requested. Something I always do after a compiling session.
lol, I fought for that from day 2. (Day one had it in my code, before BK 'cleaned it up') but If I recall 8 years ago, you'd just eject the CD/DVD to keep it from happening, seems I recalled not wanting to touch this code for some reasons pointed out, but sometime in the past a shutdown command could be called by a script and I used that.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#27 Post by MochiMoppel »

Smithy wrote:Well I have ended up with a button with a three minute (180 timeout),
You should open an "Ultra Slow Shutdown" thread :D

Even without knowing your code I see no reason for such a long timeout. Maybe you should re-read the thread.

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#28 Post by Smithy »

:)

What I meant was the shutdown dialogue will stay there for 3 minutes if you have fainted or had a senior moment or something, then it will shutdown on its own.

If you hit the yes button it will shut down immediately bam (3 secs).
If you hit no it will close the dialogue and you carry on as before.

It's your code, just time and text tweaked.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#29 Post by MochiMoppel »

Smithy wrote::)

What I meant was the shutdown dialogue will stay there for 3 minutes if you have fainted or had a senior moment or something, then it will shutdown on its own.
"Close any drives ..." suggests that the 3 minutes are meant to allow time to manual unmount your drives, which wouldn't be necessary. The initial idea for the 5sec was to remedy an accidental hit on the button. If after 5sec I don't realize that I made a mistake, then it's probably better to shutdown...
It's your code, just time and text tweaked.
I edited my Oct14 post and I don't use my original code any more though it worked fine for me. The new one is much better.

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

#30 Post by mikeb »

IIRC closing time was speeded up by playing some really bad music... perhaps that could be tried.

Saves to ram with usb removed and no hard drive gives that multisession 'hit the power button' option too :)

mike

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#31 Post by Ted Dog »

I miss the bark bark at the beginning of a good boot, may be a horrible dog whining sound at max volume at shutdown. I was dog sitting for a hurt family member and oh could that Bichon Frise could complain :roll:

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#32 Post by Smithy »

MochiMoppel wrote:

"Close any drives ..." suggests that the 3 minutes are meant to allow time to manual unmount your drives, which wouldn't be necessary.

I edited my Oct14 post and I don't use my original code any more though it worked fine for me. The new one is much better.
Yes, it was so you could check if the green lights are still on, on any drives open.

Just to clarify, if you hit close with the old simple code would it unmount any drives open,
i.e is there some routine already built in to pcs acpi or whatever it is that does that, or do you mean that your new code takes care of that?

Less button presses with your old code :wink:

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#33 Post by MochiMoppel »

Smithy wrote:Just to clarify, if you hit close with the old simple code would it unmount any drives open
You mean, if you hit "Yes"? I think it does, but frankly it's irrelevant what I think and even if we have proof that it does, it would be no reason to skip Puppy's proper shutdown procedures. If you look into the rc.shutdown script you can see that a lot of Puppy-specific clean-up takes place before finally an umount command is executed. There is no way that a standard tool like busybox can be better than Puppys own handcrafted procedures.
Less button presses with your old code :wink:
If you take the code added to my Oct14 post: Exactly the same - 1 button press :lol:

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#34 Post by Smithy »

I might stick an old drive in sometime and give it a few rigorous "tests" :wink:
Thanks.

Post Reply