Shutdown without updating savefile. Alternative method

How to do things, solutions, recipes, tutorials
Message
Author
dcc701
Posts: 62
Joined: Wed 23 Apr 2014, 07:40
Location: Seattle, US

#31 Post by dcc701 »

How true, mikeb!
Just a caution to anyone else who does the above:
This worked, but it somehow disabled rc.shutdown's asktosave function, which ceased working as soon as I created the above script.
So it might be an either/or proposition in tahrpup: either you can have a "not save" script with icon on the desktop, or you can use built-in asktosave, but not both!
I'm just kind of weighing which I prefer.
Thanks everyone!

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#32 Post by greengeek »

dcc701 wrote:This worked, but it somehow disabled rc.shutdown's asktosave function,
Yes, the quickdown script does not use rc.shutdown at all - it just uses busybox to drive the shutdown (with Musher0's additional steps to handle drive unmounting). It is just a method for a user who has already made the decision that they do not want to save (and therefore does not want a further 'ask-to-save' question)

The other method listed on page 1 involves changes to rc.shutdown but as you pointed out the shutdown functionality has all been changed in tahrpup so the method would have to be modified to accommodate the new style of rc.shutdown. Unfortunately I don't feel competent to make such changes as I have so far avoided the recent "save to file" and "asktosave" developments in favour of not running a savefile at all. (I currently use a personalised sfs instead - which does not retain daily 'saved' changes at all)

I may eventually get up to speed with the modern pups and the new shutdown methods but probably later rather than sooner.

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

#33 Post by mikeb »

Yes its all a bit obsolete to me too...been using a save sfs for years ..though that DOES save changes. I have had save folder too but never use it with puppy for other reasons plus its my scripts so different anyway.

Such fast shutdown only come into play if I manage to make the system go crosseyed experimenting :D

I suppose choosing the fast shutdown would effectively be the choice and not saving is part of that...

mike

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

rc.shutdown mod for tahrpup 6.0.2

#34 Post by gyro »

If you want to implement the original concept in Tahrpup 6.0.2, try the following:
In rc.shutdown replace

Code: Select all

if [ "$ASKTOSAVE" = "false" ]; then
  RETVAL=0
else
with

Code: Select all

if [ "$ASKTOSAVE" = "false" ]; then
  #If "No_save" flag file exists set RETVAL so save is avoided
  if [ -f "/tmp/No_save" ]; then
   RETVAL=1
  else
   RETVAL=0
  fi
else
Later code only does a save if this 'asktosave_func' returns 0

Note: Use at your own risk. It's not tested since I usually run in PUPMODE=12, and this code does not apply.

gyro

Post Reply