Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 01 Sep 2014, 04:57
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Ultra Fast Shutdown
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [34 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
jrb


Joined: 11 Dec 2007
Posts: 1033
Location: Smithers, BC, Canada

PostPosted: Sun 13 Oct 2013, 12:37    Post subject:  

mikeb wrote:
How about a less crude option...get the script to change PUPMODE to 5 so the default is to not save but all the shutdown cleanups are run.....


I don't have a pupsave file but use this
Code:
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. When I shut down Puppy tells me all changes are already saved. Wink

In other puppies I rename the stock puppy_xxx.sfs to zdrv_xxx.sfs and then create my own small puppy_xxx.sfs, much like an adrive.

Works a treat. Very Happy
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3427
Location: West Lothian, Scotland, UK

PostPosted: Sun 13 Oct 2013, 13:25    Post subject:  

mikeb wrote:
--timeout 8
just add that to the dialog line

Note with 'timeout' it carries on even if you select the alternative ..ie selecting the alternative but not hitting 'enter' still selects the default

I did this and clicked the "Save..." icon on the desktop to save the change.
Then at reboot the choice "to save or not to save" was no longer offered. Sad
It just shutdown and rebooted without any notifacation that a save was taking place.
So I've no idea whether it saved or not.

I've reverted the file to the previous arrangement, and it is now working as before I added this timeout change.
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11031
Location: Arizona USA

PostPosted: Sun 13 Oct 2013, 14:33    Post subject:  

As for the possibility that a sudden shutdown might somehow hurt the computer, I'd expect any computer designer to make sure his creation could handle a power failure without damage. The only exception would be if something is being written at the time. If I don't have anything I want to save to my multisession DVD, I simply turn off the power to my computer. I've been doing that for something like 8 years, without any damage that I'm aware of. I've even turned off my computer with hard disk drives mounted. They were just sitting there doing nothing, so no harm was done.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8223

PostPosted: Sun 13 Oct 2013, 14:44    Post subject:  

Quote:
I don't have a pupsave file but use this
Code:
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. When I shut down Puppy tells me all changes are already saved.


ah ha...now thats neat... case determines what save method.... 12 does nothing as such ...job sorted..... thats the bunny to use... fast shutdown but with clean unmounting.
I think in this case PUPMODE=13 would be needed instead of 5 to bypass the snapmerge stuff.

@ sylvander...hmm perhaps check the syntax... here's a working examplefrom my pup I am on now...

Code:
dialog --timeout 8 --defaultno --no-label "NO_SAVE" --yes-label "SAVE" --yesno "Press ENTER key or wait 8 seconds blah blah..." 0 0


you can test this stuff in a terminal to avoid live testing

Mike
Back to top
View user's profile Send private message 
Ted Dog


Joined: 13 Sep 2005
Posts: 2315
Location: Heart of Texas

PostPosted: Sun 13 Oct 2013, 23:04    Post subject:  

mikeb wrote:
hmm default is to offer to save.... forgot that glorious shutdown script which is why you all look for shortcuts..... it could be changed so the default is to not save and add a timeout but then you might as well improve the lot.
But if you are creating a script to mimic rc.shutdown then why not use it in some fashion?

Problems?...just the unmounting of drives... scripts in puppy are continually writing to temp files ...hit the wrong moment and it may upset it.

I did have a instant shutdown button years ago but only used it with a multisession harddriveless machine so there was nothing to potentially mess up

this bu**er must have missed yer thread Very Happy

mike


Lol, Done the same, the power cord was easier to reach and with multisession DVD on a driveless machine, shutdown in Zero seconds. But burned myself once after pulling files from a windows machine harddrive.
I rewrote multisession to default 'yes' 'yes' no wait, since no, no with a powercord so close was redundant. Wink
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 371
Location: Japan

PostPosted: Mon 14 Oct 2013, 00:44    Post subject:  

jrb wrote:
don't have a pupsave file but use this
Code:
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:
#!/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, 07:57; edited 1 time in total
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8223

PostPosted: Mon 14 Oct 2013, 05:05    Post subject:  

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 Very Happy

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

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

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.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Sat 19 Oct 2013, 22:33    Post subject:  

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 Laughing

_________________
«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 Razz
Back to top
View user's profile Send private message Visit poster's website 
MochiMoppel


Joined: 26 Jan 2011
Posts: 371
Location: Japan

PostPosted: Sat 19 Oct 2013, 23:44    Post subject:  

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.
Back to top
View user's profile Send private message 
Smithy


Joined: 12 Dec 2011
Posts: 421

PostPosted: Sun 20 Oct 2013, 04:38    Post subject:  

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.
image-1.png
 Description   
 Filesize   165.49 KB
 Viewed   248 Time(s)

image-1.png

fastshutdown1.png
 Description   
 Filesize   39.92 KB
 Viewed   255 Time(s)

fastshutdown1.png


Last edited by Smithy on Sun 20 Oct 2013, 05:07; edited 2 times in total
Back to top
View user's profile Send private message 
Ted Dog


Joined: 13 Sep 2005
Posts: 2315
Location: Heart of Texas

PostPosted: Sun 20 Oct 2013, 04:51    Post subject:  

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 Very Happy

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

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

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.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 371
Location: Japan

PostPosted: Sun 20 Oct 2013, 05:33    Post subject:  

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

Even without knowing your code I see no reason for such a long timeout. Maybe you should re-read the thread.
Back to top
View user's profile Send private message 
Smithy


Joined: 12 Dec 2011
Posts: 421

PostPosted: Sun 20 Oct 2013, 06:31    Post subject:  

Smile

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.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 371
Location: Japan

PostPosted: Sun 20 Oct 2013, 07:21    Post subject:  

Smithy wrote:
Smile

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...

Quote:
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.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8223

PostPosted: Sun 20 Oct 2013, 07:26    Post subject:  

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 Smile

mike
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 3 [34 Posts]   Goto page: Previous 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1034s ][ Queries: 12 (0.0043s) ][ GZIP on ]