Author |
Message |
greengeek

Joined: 20 Jul 2010 Posts: 4945 Location: Republic of Novo Zelande
|
Posted: Tue 27 Nov 2012, 15:58 Post subject:
Shutdown without updating savefile. Alternative method Subject description: Save time during final shutdown |
|
Do you want to be able to shut down your usb puppy quickly? Without waiting for the final savefile update which can often take several minutes if you have a slow usb stick or lots of data waiting to be updated?
Puppy usb installs are usually set with the default setting to save all data to the savefile periodically, and that can be a useful function so that you capture whatever work you have been saving into Puppy's internal file structure. However, I don't always want to allow the final pupsave that occurs during the powerdown sequence. Sometimes I just want to shutdown quickly with a single click. no questions asked.
This might be because I am in a hurry and don't care about any new data I've just been viewing/downloading, or it might be that I am choosing to discard changes that I have just made (eg: I might have accidentally removed a critical folder and I don't want that deletion to become permanent)
I want to highlight two methods that can be used to achieve this:
1) There is a superquick way to shut down your usb puppy.
***WARNING*** This method is potentially dangerous, and there may be significant risk to your data.***WARNING***
If you want to take this risk (and sometimes I do...) the topic is here:
http://www.murga-linux.com/puppy/viewtopic.php?t=67084
(also another similar discussion here: )
http://www.murga-linux.com/puppy/viewtopic.php?t=89282
2) I also have another method which does NOT bypass the normal "soft" shudown procedures, it just bypasses the final pupsave procedure. You don't have to go through the normal shutdown menu, you just click a desktop icon which forces an immediate shutdown without save, but with all the normal unmounts etc. It can save you several minutes of valuable time.
Here is how to do it:
a) First we need to modify the shutdown file so that it is ready to wait for our "no_save" command:
Locate file /etc/rc.d/rc.shutdown and open it as text.
Search for "13)" and/or "snapmergepuppy" and find the paragraph that looks like the code snippet below:
Add in 3 extra lines as shown embedded here:
Code: | 13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has ${DISTRO_FILE_PREFIX}save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
#Start "if" test for "No_save" flag file and save only "if" file "/tmp/No_save" does actually exist
if [ ! -f "/tmp/No_save" ];then
echo "`eval_gettext \"Saving session to \\\${SAVEFILE} (\\\${SAVEPART})...\"`" >/dev/console
#echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
fi #end "if" test.
;; |
(Thanks 01micko for the "if" code - I couldn't have done it without that...)
b) Write a script containing the following code and put it into /usr/bin
Code: | #!/bin/sh
echo "test" > /tmp/No_save
/usr/bin/wmpoweroff |
(This script will create a temporary "flag file" which will tell the shutdown procedure NOT to save. We will call this script from a new desktop icon. I called my script "No_save" but any name without spaces is fine)
c) Drag this script onto the desktop (creates a symlink). Right click it and add an icon if you wish. (I have attached a super high quality one if you are desperate)
*******IMPORTANT NOTE*******
You must now force (or wait for...) a "save to savefile" to occur, otherwise these changes will not be retained.
In other words - don't trial the new icon until after everything is saved into your savefile, or else all you will do is shutdown without saving the changes!
.
Description |
Free, high quality icon |
Filesize |
4.3 KB |
Viewed |
3834 Time(s) |

|
Description |
Save or don't save - your choice |
Filesize |
16.4 KB |
Viewed |
3803 Time(s) |

|
Last edited by greengeek on Mon 14 Oct 2013, 01:07; edited 1 time in total
|
Back to top
|
|
 |
Pelo
Joined: 10 Sep 2011 Posts: 12591 Location: Mer méditerrannée (1 kms°)
|
Posted: Tue 11 Dec 2012, 11:08 Post subject:
alternate method : pet pupsavconfig Subject description: When you leave (message save no save) |
|
http://www.murga-linux.com/puppy/viewtopic.php?search_id=780272280&t=78055
Same process as for the first use of the distro .
|
Back to top
|
|
 |
greengeek

Joined: 20 Jul 2010 Posts: 4945 Location: Republic of Novo Zelande
|
Posted: Tue 11 Dec 2012, 13:44 Post subject:
|
|
Thanks Pelo. Does pupsaveconfig allow you to place an icon on the desktop to shutdown immediately without saving? I looked at that forum post but my french is not good I m afraid.
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2805 Location: Montenegro
|
Posted: Tue 11 Dec 2012, 14:00 Post subject:
|
|
I think your first post just answered my question, this Nosave flag is what I need I think
http://murga-linux.com/puppy/viewtopic.php?p=670536#670536
EDIT: Nope, please ignore I see you modified rc.shutdown for that flag file my bad for skimming through thread
_________________ puppy.b0x.me stuff mirrored HERE or HERE
Last edited by dejan555 on Tue 11 Dec 2012, 14:13; edited 1 time in total
|
Back to top
|
|
 |
Sylvander
Joined: 15 Dec 2008 Posts: 4328 Location: West Lothian, Scotland, UK
|
Posted: Tue 11 Dec 2012, 14:07 Post subject:
|
|
What if the user wants to REBOOT without saving the session changes?
Oops...
You made the following post during my edit.
e.g. I often want to make no session saves during the session...
Then reboot into a new session without saving during the reboot.
This would typically be a banking or buying session...
Or opening multiple unusual web-pages that I don't want to save...
Then reboot into a normal session->[open at the Puppy Forums plus the PC-Guide Forums]...
During and after which I would probably again save no changes, but then again I might.
Last edited by Sylvander on Tue 11 Dec 2012, 14:15; edited 2 times in total
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2805 Location: Montenegro
|
Posted: Tue 11 Dec 2012, 14:09 Post subject:
|
|
then use wmreboot in script instead wmpoweroff
_________________ puppy.b0x.me stuff mirrored HERE or HERE
|
Back to top
|
|
 |
Sylvander
Joined: 15 Dec 2008 Posts: 4328 Location: West Lothian, Scotland, UK
|
Posted: Tue 11 Dec 2012, 14:21 Post subject:
|
|
With my present arrangement...
I can choose to either shutdown or reboot...
And THEN I'm asked whether "to save or not to save"...
"Don't save" is the default, and that's my usual choice [I just hit "Enter" to "OK" that].
Is there any way with the above method to choose the one or the other?
i.e.
REBOOT and don't save...
Or...
SHUTDOWN and don't save.
I imagine the user should make 2 shortcuts:
1 with its script using wmreboot...
The other with its script using wmpoweroff.
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2805 Location: Montenegro
|
Posted: Tue 11 Dec 2012, 14:37 Post subject:
|
|
Yes, there are ways to do it with one script and simple dialog box where you would have just shutdown and reboot buttons and wouldn't save session, or you could just write script to write the No_save file and then shutdown or reboot from normal menu, wmpoweroff/wmreboot is really not needed in script but then you need to click the script to make file and then regularly use menu's shutdown/reboot
_________________ puppy.b0x.me stuff mirrored HERE or HERE
|
Back to top
|
|
 |
greengeek

Joined: 20 Jul 2010 Posts: 4945 Location: Republic of Novo Zelande
|
Posted: Tue 11 Dec 2012, 14:45 Post subject:
|
|
Sylvander wrote: | e.g. I often want to make no session saves during the session...
Then reboot into a new session without saving during the reboot.
|
So possibly what you want is an icon which basically could be called "Temporarily suspend savefile updates and then do not save at shutdown"?
Or maybe two icons:
1) "Temporarily suspend savefile updates"
2) "Shutdown without saving" (like my icon)
I will give this some thought.
|
Back to top
|
|
 |
greengeek

Joined: 20 Jul 2010 Posts: 4945 Location: Republic of Novo Zelande
|
Posted: Tue 11 Dec 2012, 14:55 Post subject:
|
|
dejan555 wrote: | http://murga-linux.com/puppy/viewtopic.php?p=670536#670536 |
Hi dejan, when I first started looking at how to alter savefile behaviour during shutdown I realised that there are other files in the loop aswell - one of which looks at whether or not the savefile already exists (and if not it asks to create one). Maybe there will be some reminder for you in this post:
http://murga-linux.com/puppy/viewtopic.php?t=78228&start=36
Maybe it was one of those other files you originally modified?
Maybe a search for "snapmergepuppy" in the rc.shutdown file will help you spot which part of the dialog looks for a savefile? I will try to find something later tonight.
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2805 Location: Montenegro
|
Posted: Tue 11 Dec 2012, 15:02 Post subject:
|
|
I'm looking at /usr/sbin/shutownconfig now it seems Barry moved some code from rc.shutdown there, the puppy version I remastered for my desk before is older so the scripts changed a lot I guess. Haven't done much scripting or modifyng for a while so I need some time to catch on things
_________________ puppy.b0x.me stuff mirrored HERE or HERE
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 2420 Location: Germany
|
Posted: Tue 11 Dec 2012, 15:30 Post subject:
|
|
A picture is telling more than a thousand words.
Already done in LazY Puppy 2!
Description |
|
Filesize |
29.54 KB |
Viewed |
3613 Time(s) |

|
_________________ LazY Puppy
RSH's DNA
SARA B.
|
Back to top
|
|
 |
Sylvander
Joined: 15 Dec 2008 Posts: 4328 Location: West Lothian, Scotland, UK
|
Posted: Tue 11 Dec 2012, 15:44 Post subject:
|
|
greengeek wrote: | Or maybe two icons:
1) "Temporarily suspend savefile updates"
2) "Shutdown without saving" (like my icon) |
A. My present arrangement:
1. My pupsave on a partition on an internal HDD is treated as though it's a pupsave on a Flash Drive.
To do this I edit one of the settings in a file in the Puppy ISO.
Then...
2. I set the save interval to zero [0], so that there is no auto-save during the session.
3. If I want to save during the session, I click the "Save" icon on the desktop.
SO...
I think what you need is...
B. Three icons:
1. An icon to set the save interval to zero on 1st click...
Click once more and the save interval goes back to the default 30 min.
Does your "Temporarily suspend savefile updates" do [something like] this?
2. An icon to "Shutdown without saving".
3. An icon to "Reboot without saving".
--------------------------------------------------------------------------------------------------------
C. Oops, RSH got in with that post whilst I was typing my own response.
I don't have Lazy Puppy in my stack of 7 Puppy Cd's.
I believe I tried your version 2.0.2 [17th June 2012][still have that ISO] and found it wouldn't boot on my 2012 64-bit desktop PC
[Asrock H61M-S mobo].
|
Back to top
|
|
 |
greengeek

Joined: 20 Jul 2010 Posts: 4945 Location: Republic of Novo Zelande
|
Posted: Tue 11 Dec 2012, 17:12 Post subject:
|
|
Sylvander wrote: | 1. An icon to set the save interval to zero on 1st click...
Click once more and the save interval goes back to the default 30 min.
Does your "Temporarily suspend savefile updates" do [something like] this? |
I don't have such an icon yet - I was wondering if that was the function you wanted. I think that's a nice idea to have an icon to switch between savetime of 0 and 30. (ie: this icon could be called "switch between auto save & manually controlled save"). Maybe the icon could just bring up a dialog? (although I prefer to use just a single click...)
Maybe we need RSH version of shutdown menu all the time on the desktop.
RSH wrote: | Already done in LazY Puppy 2! | Nice.
|
Back to top
|
|
 |
Barkin

Joined: 12 Aug 2011 Posts: 823
|
Posted: Tue 11 Dec 2012, 19:56 Post subject:
|
|
IMO the "save" and "nosave" icons above are too similar and could be mistaken for each another. They should be much more dissimilar, e.g. attached ...
Description |
another nosave icon |
Filesize |
2 KB |
Viewed |
3604 Time(s) |

|
Description |
another nosave icon |
Filesize |
2.27 KB |
Viewed |
3436 Time(s) |

|
Description |
alternative nosave icon |
Filesize |
3.42 KB |
Viewed |
3454 Time(s) |

|
Last edited by Barkin on Tue 11 Dec 2012, 20:47; edited 2 times in total
|
Back to top
|
|
 |
|