HOWTO stop puppy from saving when shutting down.

How to do things, solutions, recipes, tutorials
Message
Author
bilko1808
Posts: 17
Joined: Sun 03 Apr 2011, 21:05

HOWTO stop puppy from saving when shutting down.

#1 Post by bilko1808 »

It took me ages to find a simple solution without being referred to posts many years old, not knowing if they work on the version that you have got, editing files etc.

This is for booting puppy from USB, until further tests are carried out not sure what effect it will have on other methods of running puppy.

If you don't want to save when you power down or reboot your system use the following.

I really hope I've made this simple enough for even beginners like me to understand what and how to do it.

Works for Puppy 5.2 and 5.2.5 (probably works for other versions but haven't test it)

POWEROFF

Navigate to a folder of your choice (I used "my-applications")
Create a new script (right click in blank space in folder, select New >> Script, name it poweroff)
Right click on your poweroff script >>> open as text

Copy and paste the following into it:

Code: Select all

#!/bin/sh

# skips rc.shutdown and powers off computer without saving the session.
Xdialog --title "script $0" --yesno "\n\nAre you sure to power-off computer WITHOUT saving?\n\n" 0 0
[ $? -eq 0 ] && exec /bin/busybox poweroff
Click Save then exit the file.
Right click poweroff file >>> Set Icon, get a suitable Icon for it.
Drag it to your desktop to create a link to it.


REBOOT

Follow same steps as above except call the file reboot, and copy the following into the reboot script instead.

Code: Select all

#!/bin/sh

# skips rc.shutdown and reboots computer without saving the session.
Xdialog --title "script $0" --yesno "\n\nAre you sure to reboot computer WITHOUT saving?\n\n" 0 0
[ $? -eq 0 ] && exec /bin/busybox reboot
IMPORTANT

Click the SAVE bullseye now or you will lose the file/s you just made.

CREDITS

Thanks to MochiMoppel for the scripts. They were found at the end of a second page so I thought I would post them as a HOWTO so they should be found a lot easier.
Last edited by bilko1808 on Thu 21 Apr 2011, 21:32, edited 4 times in total.

shadower_sc
Posts: 136
Joined: Wed 21 Apr 2010, 23:03
Location: Texas

Woot! :-)

#2 Post by shadower_sc »

I will have to test this out. It looks much simpler than editing the /etc/rc.d/rc.shutdown file.

(Referring to the rc.shutdown file.)
I comment out lines 628 - 732 in Lucid Puppy 5.2, and lines 630 - 735 in Lucid Puppy 5.2.5. As far as I can tell this keeps Puppy from saving on shutdown when your first boot. I think it should still save the Puppy Save file, if you already have a Puppy Save file.

bilko1808
Posts: 17
Joined: Sun 03 Apr 2011, 21:05

#3 Post by bilko1808 »

This I what I use, it only stops the save.

If i want to save I just use the desktop save bullseye, or shutdown/reboot via the Menu.

Using either of these scripts stops puppy from automatically saving, but it will carry on saving if you have got it set to save at intervals in the:

Menu->System->Puppy Event Manager->save session->save Interval

I have the save interval set to 0 so it only saves if i save via bullseye or normal menu shutdown/reboot method.

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#4 Post by nooby »

Bilko thanks indeed for that one. it is late here now so have no much time. I test this tomorrow on many puppies in frugal install to see what happens.

Much appreciated you spend those two hours. I try to find the link to it tomorrow. 10.40 now so feel too tired :)
I use Google Search on Puppy Forum
not an ideal solution though

bilko1808
Posts: 17
Joined: Sun 03 Apr 2011, 21:05

#5 Post by bilko1808 »

It's the scripts I use for puppy booting from USB, no idea what effect it will have on frugal install. Will edit my first post to include that its for me with puppy running from usb.

Post back and let me know how it goes so I can include it in the first post.

Thanks

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#6 Post by nooby »

The frugal install has another pup state so it has no such save button.
Sergey below explains what happens

Bilko you are right about the usb flash thing and HDD another thing indeed.

Here is Sergey confirming it
http://murga-linux.com/puppy/viewtopic. ... 767#501767

Setting pmedia=usbflash does not work in the latest Puppy
versions I use -- Lighthouse 500-G, Quirky 1.4, Wary5.1.1

Puppy doesnt boot: can't find media -- it must be looking
for a USB something, because it spends some time looking.

I'm using Grub so I applied your suggestion in menu.lst and
tried all variations in syntax based on Grub's README,
For example, on kernel line using (hd0,1)/quirky140.

My method of setting PUPSTATE=5 described in my earlier post
has worked in Lighthouse, Quirky, and Wary for months for me.
It's easy although lacking the characteristic s-m-o-o-t-h,
elegance of Puppy operations. (link to that post by Sergey here
http://murga-linux.com/puppy/viewtopic. ... 931#497931 )

BTW, Wary 5.1.1 is very fast to reboot, which saved me
lots of time as I rebooted dozens of times for these
experiments.
Bilko I maybe found the source look here

http://www.murga-linux.com/puppy/viewto ... 814#497814
or else use the search i nmy sig and put in from the hashed comments to find it
Edit forget about the link I gave to another thread. it is about SFS-exec and
I must have misunderstood the English of Jasper due to I am not a native user of the language.

Thanks Bilko, I am looking for a solution that works for frugal on HD NTFS at that but it is late at night now so I pull the plug for today. :)
Last edited by nooby on Thu 21 Apr 2011, 21:28, edited 1 time in total.
I use Google Search on Puppy Forum
not an ideal solution though

bilko1808
Posts: 17
Joined: Sun 03 Apr 2011, 21:05

#7 Post by bilko1808 »

Thanks, that's the post I got it from, didn't fancy trawling through loads of threads until I found it again.

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#8 Post by nooby »

Sorry me so dense

If I get it at all what you describe works if one have the pupsave on usb but not on hdd?
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

Re: HOWTO stop puppy from saving when shutting down.

#9 Post by Dougal »

bilko1808 wrote:If you don't want to save when you power down or reboot your system use the following.
You've made it more complicated than it should be and also possibly harmful... shutting down involves more than just saving to the pup_save: there are services to shut down properly, some kernel modules to unload etc. and without some of those things some computers might hang.

I mentioned this on another thread a couple of months ago:
- edit /etc/rc.d/rc.shutdown, to comment out the relevant line where snapmergepuppy is run (you want the PUPMODE 13 case, but you could just as well comment out all the instances of snapmergepuppy)
- where you commented out snapmergepuppy, add a line:

Code: Select all

[ -f /initrd/pup_ro1/etc/.XLOADED ] && rm /initrd/pup_ro1/etc/.XLOADED
this is needed so there won't be a problem with X starting at next boot.

This will completely disable saving at normal shutdown. If you want to give a dialog with an option to choose, just make it run snapmergepuppy if the user chose to save, then continue with the shutdown as usual...
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#10 Post by nooby »

Dougal but would that work for frugal install on HDD too?
One need to go into initrd.gz and change lines there so it accept to be pupmode 13?
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#11 Post by Dougal »

nooby wrote:Dougal but would that work for frugal install on HDD too?
One need to go into initrd.gz and change lines there so it accept to be pupmode 13?
I'm pretty sure I mention this in the post I linked above: adding pupmode=13 to the bootloader entry should solve that.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#12 Post by nooby »

Oh is it that easy? pupmode=13 on kernel line doing grub4dos boot?

I forgot to tell you that I am on NTFS and others have failed to get pupmode 13 going on NTFS without rewriting initrd?
I use Google Search on Puppy Forum
not an ideal solution though

bilko1808
Posts: 17
Joined: Sun 03 Apr 2011, 21:05

#13 Post by bilko1808 »

Thanks Dougal. i totally failed when editing the rc.shutdown. among many of the pages i read one of them suggested it's a bad idea to alter system files such as rc.shutdown. i've run out of internet credit for now but will have a go at further research once i get some more.

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#14 Post by nooby »

But one sure way would be to do as Seaside does.
To first make a pupsave file with the prefrences one want and need and then change that one into a zq142332.sfs file and such get loaded at boot but they don't get written to. that way one keep the preferences but have no savefile to save to.

what can go wrong there? Maybe that it only works on ext3 or fat32 usb?
I don't remember but it is worth a try. having no pupsavefile would be rather safe from errors like installing apps that one later want to scrap and this way they don't add to a growing save file.

instead one learn to make sfs and can load then on the fly without rebooting. Very fast loading of such sfs files.

The only bad thing is that the bookmarks fails so one need to place them in the cloud or come up with them in html files that one load or something.
I use Google Search on Puppy Forum
not an ideal solution though

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#15 Post by seaside »

nooby wrote:But one sure way would be to do as Seaside does.
To first make a pupsave file with the prefrences one want and need and then change that one into a zq142332.sfs file and such get loaded at boot but they don't get written to. that way one keep the preferences but have no savefile to save to.

what can go wrong there? Maybe that it only works on ext3 or fat32 usb?
I don't remember but it is worth a try. having no pupsavefile would be rather safe from errors like installing apps that one later want to scrap and this way they don't add to a growing save file.

instead one learn to make sfs and can load then on the fly without rebooting. Very fast loading of such sfs files.

The only bad thing is that the bookmarks fails so one need to place them in the cloud or come up with them in html files that one load or something.
Nooby,

As you discovered, there are some limitations to using a zdrive sfs instead of a savefile.

I think you can make a harddisk frugal install that will create a "pupstate=13" by using "pmedia=ideflash". Pmedia=usbflash apparently limits the search to usb media only- resulting in puppy files not found.

Please try it out.

Regards,
s

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#16 Post by nooby »

Seaside that looks interesting yes. Sure I should try it.
I did test in snowpup5 that is a lupu511 named 513 and that one succeed when I corrected a spelling error that I typically made pmedia=ideflash

I added the puppy pupmode=13 on kernel line and it has now a red save button.
cat /etc/rc.d/PUPSTATE
says that I have 13 too.

Does that mean it has not 30 minutes but 0 in there where ever that where placed?

So now I have forgotten why we did all this. Okay so one can screw up an install and just reboot and the screw up is gone?
I am in snow5 and will install your SFS-Exec again.


Problems abound. I can not make the savfile a zl file due to snow already have a zl513357.sfs file for drivers.
So maybe I need to go to snow15 instead that one has no such zl drivers file.
I use Google Search on Puppy Forum
not an ideal solution though

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#17 Post by seaside »

nooby wrote:Seaside that looks interesting yes. Sure I should try it.
I did test in snowpup5 that is a lupu511 named 513 and that one succeed when I corrected a spelling error that I typically made pmedia=ideflash

I added the puppy pupmode=13 on kernel line and it has now a red save button.
Nooby,

From my understanding of the boot initrd file coding, just adding pmedia=ideflash should set the puppy search for pup media files to look only at internal disks and then after it finds puppy files, the parameter of "pmedia=ideflash" defaults to "pupmode=13".

You can easily check, after booting, by typing in a terminal
"df" and see if it shows something like this-

Code: Select all

/dev/loop1               51727     27268     24459  53% /initrd/pup_ro1
which means the pupsave file is mounted on /initrd/pup_ro1 instead of "/initrd/pup_rw".

Great progress and now you perhaps can use the "SFS-Exec-pupsave" successfully :)

Regards,
s
(Some pups use a zdrive file for other purposes, so probably best to not use the zdrive method and just have a "locked" savefile of pupmode=13 which should work for all versions)

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#18 Post by nooby »

So I should take away the pupmode=13 then and test as you described.

Okay.

the SFS-Exec-pupsave how is that one different from the save there is there now then? I've already forgot. Okay I should read the original thread.

df gave this sh-4.1# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 231506208 141588184 89918024 62% /initrd/mnt/dev_save
/dev/loop1 516040 56084 459956 11% /initrd/pup_ro1
tmpfs 512488 3392 509096 1% /initrd/pup_rw
/dev/loop0 234112 234112 0 100% /initrd/pup_ro2
unionfs 512488 3392 509096 1% /
shmfs 238716 12 238704 1% /dev/shm
sh-4.1#

"SFS-Exec-pupsave" did not work, I even restared x and nothing show up. Should it not have even two save buttons as I remember.

I edit out the pupmode=13 now and see what gives
I use Google Search on Puppy Forum
not an ideal solution though

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#19 Post by seaside »

nooby wrote:So I should take away the pupmode=13 then and test as you described.

Yes

the SFS-Exec-pupsave how is that one different from the save there is there now then? I've already forgot. Okay I should read the original thread.

The save icon that appears after boot is the original that does a simple save to the pupsave file. (You should remove this if you install "SFS-Exec-pupsave".)

When "SFS-Exec-pupsave" is installed, it creates it's own icon and script to "unlock", save, and "lock" the pupsave file.

Regards,
s

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#20 Post by nooby »

Unfortunately this did not happen
When "SFS-Exec-pupsave" is installed, it creates it's own icon and script to "unlock", save, and "lock" the pupsave file.

and also I lost symlinks to a lot of files I usually have on desktop and it acted strangely so I gave up on it for today. I maybe test Quirky 142 tomorrow but not on snow 15 anymore.

Late at night here so I turn in now will go buy shoes for the summer tomorrow :)
I use Google Search on Puppy Forum
not an ideal solution though

Post Reply