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 Sat 23 Aug 2014, 11:28
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to turn off autosave for USB flash install?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Author Message
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Sun 29 Jun 2008, 08:13    Post subject:  How to turn off autosave for USB flash install?  

Note from Flash (Admin): I split this thread off from this one.

htnakirs wrote:
...Pizza : What is this autosave daemon that you refer to and where can I disable it?

These directions use Puppy 3.01. Other Puppies should be fairly similar.

Daemon: /usr/sbin/savepuppyd
Find these lines:
Code:
#only run if need to save tmpfs periodically...
SAVETMPFS="no"
[ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ] && SAVETMPFS="yes"
[ "$SAVETMPFS" = "no" ] && exit

Place a '#' in front of the third line, like so:
Code:
#only run if need to save tmpfs periodically...
SAVETMPFS="no"
#[ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ] && SAVETMPFS="yes"
[ "$SAVETMPFS" = "no" ] && exit

Now Puppy should only save when it reboots.

Shutdown script: /etc/rc.d/rc.shutdown
There should be a group of lines like this:
Code:
 13) #PDEV1 and PUPSFS and PUPSAVE
  #/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
  #the above are in unionfs at /.
  echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
  /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
  ;;

Modify it to be more like this:
Code:
 13) #PDEV1 and PUPSFS and PUPSAVE
  #/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
  #the above are in unionfs at /.
  dialog --yesno "Save session?" 0 0 >/dev/console
  if [ $? -eq 0 ]; then
   echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
   /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
  fi
  ;;

That should make it prompt before saving on shutdown with a Flash install.


Sorry for not posting this stuff last night. I was too tired.

EDIT 2009-03-18: Forgot that the dialog command must be redirected to /dev/console. Corrected instructions.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib


Last edited by Pizzasgood on Wed 18 Mar 2009, 13:15; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
Bruce B


Joined: 18 May 2005
Posts: 11084
Location: The Peoples Republic of California

PostPosted: Sun 29 Jun 2008, 08:45    Post subject:  

Pizzagood,

What do you think of the practicality of using a script to turn savepuppyd on or off, according to the type of session he wants?

Bruce
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Sun 29 Jun 2008, 11:58    Post subject:  

Wouldn't be hard. Just have a flag file somewhere that it checks before attempting to save. Then there could be a toggle script that would change it from "true" to "false".

You could also just kill or restart it, but I think that in some Puppies it's in charge of things besides just saving.

I believe Barry was talking about adding a settings panel in Puppy 4.1 that would let you disable the daemon. And I think he also modified it to use interrupts rather than just looping and sleeping.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
matrix88

Joined: 16 Dec 2008
Posts: 4

PostPosted: Tue 16 Dec 2008, 14:24    Post subject: things have changed for saving ?  

I just installed Puppy Linux yesterday and am thrilled to find this version (does so much more and better than my other 'tiny' Linux). I'm trying to get up to speed on a couple things regarding the pup_save file and have had trouble locating how this is done with the current version. The above suggestion sounded great but it seems that is now in the pup_eventd file?

I'm using this on a flash drive and now that I have things configured would like to disable all saving (for my situation) except when I manually choose to save.
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Tue 16 Dec 2008, 18:53    Post subject:  

The part about the /etc/rc.d/rc.shutdown script hasn't changed yet. The relevant section should be at line 671 in Puppy 4.1.2, and somewhere nearby in other versions.

The stuff about the periodic saving is now unneeded. Instead, you can just go to "Menu->System->Puppy Event Manager". Switch to the "Save Session" tab and change the "Save interval" to 0, which will tell it to not periodically save.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
KJ

Joined: 20 Jul 2006
Posts: 176
Location: Above sea level .. about 320m

PostPosted: Tue 10 Mar 2009, 14:55    Post subject:  

pizzasgood, Just found this thread a couple days ago and tried the "13)" part of your solution with the "save interval set to 0" on a puppy412 (fatdog111) usb-frugal install. I cut and pasted your "13)" section which stops the shutdown (or reboot), goes to a blinking prompt and waits for an input. However, the "save session" comment does not show on the screen and "enter" or any key (other than ' n') plus "enter" results in a regular save.

Most interestingly, reversing "yesno" to "noyes" in your "13)" section creates an automatic shutdown without a "yes" possibility in about 5 seconds and the manual "save" button put on the desktop by the usb-frugal install works great so I now have just about what I've wanted for a long time. A reasonably secure "manual save only" usb Puppy for surfing the web.
Back to top
View user's profile Send private message 
KJ

Joined: 20 Jul 2006
Posts: 176
Location: Above sea level .. about 320m

PostPosted: Tue 10 Mar 2009, 22:36    Post subject:  

Forgot to clarify .... these results are with a frugal install on a bootable usb flash drive. KJ.
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Fri 13 Mar 2009, 22:41    Post subject:  

Odd. What do these command do when run in a terminal:
Code:
dialog --yesno "Save session?" 0 0
echo $?
which dialog

On my system, they show a menu and return '0' for choosing 'yes', '1' for 'no', and '255' for the ESC key. It also tells me that 'dialog' is at /usr/bin/dialog.

If they work from a terminal on your end, then either you made an error in implementing the dialog command in the script, or something weird is going on in the script - like the path being broken, 'dialog' being aliased, or some other weirdness.

If you don't care and just want it to not save, you could just comment out that entire 13) section, from the 13) to the ;;. Currently, I believe what you've done is give 'dialog' an invalid parameter (It doesn't have a --noyes option), causing it to return with an error code of 255 and thus fail the if statement. (I only "believe" that, rather than know, because I'm not sure what else is going on in your situation.) Doing it that way works, but isn't a very "good" way to do it.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
awatar100

Joined: 16 Mar 2009
Posts: 3

PostPosted: Mon 16 Mar 2009, 05:52    Post subject:  

Hello
I read all post above - i comment this line in rc.shutdown but all that i made in sesion still is save to flash drive
I have CF on IDE board.
In puppy event menager Save Session - i set interval to 0

So i still have problem - HOW TO STOP SAVING session in puppy linux that is on CF !?!?!
Back to top
View user's profile Send private message 
KJ

Joined: 20 Jul 2006
Posts: 176
Location: Above sea level .. about 320m

PostPosted: Mon 16 Mar 2009, 12:27    Post subject:  

Pizzasgood .... Thanks for your reply. Tried your "test" from a rxvt and got a blue background with a "save session?" comment block with "yes" and "no" buttons. No verbage about 255. I get this output with both "noyes" and "yesno".

I have used your section 13 revision with "yesno" on a bootable frugal installed standard Puppy412, Puppy 410F, and FatDog111 (412 based) usb flash drives and get the same test output but different actual shutdown results according to the hardware and usb flash drive I'm using but no case do I get a comment box with buttons or text of any kind.

The manual save button on the desktop has worked in all cases.

Thnaks for you help... KJ
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Mon 16 Mar 2009, 14:32    Post subject:  

@awatar100: Look in /etc/rc.d/PUPSTATE and tell me what PUPMODE you have.


KJ wrote:
Pizzasgood .... Thanks for your reply. Tried your "test" from a rxvt and got a blue background with a "save session?" comment block with "yes" and "no" buttons. No verbage about 255.
The 0, 1, or 255 are what are returned by running echo $? immediately after chosing yes/no or pressing 'esc' in the dialog. That command displays the return code from the last program to run in that terminal.

KJ wrote:
I get this output with both "noyes" and "yesno".
When I try using '--noyes', it fails with this error message:
Code:
Error: Unknown option --noyes.
Use --help to list options.

So maybe you have a different version of the 'dialog' program than I do. What do you get when running which dialog and dialog --version

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
KJ

Joined: 20 Jul 2006
Posts: 176
Location: Above sea level .. about 320m

PostPosted: Mon 16 Mar 2009, 23:37    Post subject:  

@ pizzasgood

#dialog --version

returns:
Version: 1.0-20060221

in both puppy412 and fatdog111.

Commenting out rc.shutdown 13) produces a "session not saved" and a clean shutdown with nothing automatically saved ... Sweet. A manual save only works great for me as I usually have several different small save.2fs and something keeps filling them up slowly with no changes or saves made by me. Eliminating most saves should at least slow the problem down.

Thanks again - KJ
Back to top
View user's profile Send private message 
awatar100

Joined: 16 Mar 2009
Posts: 3

PostPosted: Tue 17 Mar 2009, 12:40    Post subject:  

Pizzasgood
In this file PUPMODE = 7
From what i google my pupmode have to be something about 13 ?
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Tue 17 Mar 2009, 22:07    Post subject:  

The difference between 7 and 13 is that in 7 you save directly to the partition, whereas in 13 you save to a pup_save.2fs file on the partition.

For mode 7, I believe you can still follow the same directions, but instead of using the section for '13)', use the one for '7)' which is just above it.

@KJ: Well, that's the same as what I get. Maybe I'm making a bad assumption somewhere. I'll poke around tomorrow and make sure this still works right on my computer.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Wed 18 Mar 2009, 13:14    Post subject:  

Okay, the problem is that the dialog command needs to be redirected to /dev/console, like this:
Code:
  dialog --yesno "Save session?" 0 0 >/dev/console

Sorry, dumb oversight on my part. I've gone back and corrected my instructions.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
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.0934s ][ Queries: 11 (0.0108s) ][ GZIP on ]