True. I've now stolen your icon for future use and also modified the save one. Thanks!Barkin wrote:IMO the "save" and "nosave" icons are too similar and could be mistaken for each another.
Shutdown without updating savefile. Alternative method
- Attachments
-
- save grn.jpg
- (31.84 KiB) Downloaded 965 times
Hi greengeek--Thanks for reply. I actually did recently post a newbie question on the issue of customizing defaults on that tahrpup save/notsave shutdown routine. That is working, but I'm thinking for my use it'd also be nice to just have a "forget" button on the desktop, right near the "save" button!
mikeb--That looks like some serious code there! Would it fry my computer?
mikeb--That looks like some serious code there! Would it fry my computer?
well a terminal one liner ... just goes straight to busybox shutdown... its not really any worse than the normal shutdown routine in terms of drive unmounting.mikeb--That looks like some serious code there! Would it fry my computer?
the nohup makes sure it carries on regardless to the bitter end Also handy if you ever remote control a pup.
mike
This will bypass the normal 'soft shutdown' features though won't it? What about sfs, drive and filesystem unmounts? By still using the rc.shutdown method I was trying to retain those functions for safety - just avoiding the save process itself.mikeb wrote:nohup busybox shutdown
EDIT : I do use a different method on some of my systems - I made an icon and script I call "Quickdown". Don't know if it would be applicable to other Tahrpups but here is the code:
Code: Select all
#!/bin/bash
#2014May16 greengeek code to unmount drives then perform busybox shutdown. Intended for
#use with BanksyPup live puppy environment where quick shutdown without save is required.
####Musher0 code to unmount only disks
df -H -T -x squashfs -x tmpfs -x rootfs -x aufs -P | grep "/mnt/s" | cut -f2 -d'm' > spc_dsq.txt
while read line
do
umount /m$line
done < spc_dsq.txt
rm -f spc_dsq.txt
sleep 3
exec /bin/busybox poweroff
- Attachments
-
- quickdown48.png
- (4.87 KiB) Downloaded 414 times
-
- desktop_shutdown_options.jpg
- (7.39 KiB) Downloaded 416 times
Yes, I place it in /usr/bin.dcc701 wrote: Is your "Quickdown" script in /usr/bin?
I think it should be fine in Tahrpup - especially if you replaced the last line (invoking busybox) with mikeb's version (using nohup with busybox)Does anyone know if this would be OK for tahrpup or not?
It would be worth trying by booting Tahr in "live session" with your savefile/savefolder hidden temporarily. If it works this way then I would expect it to work with savefile/savefolder too.
perhaps nohup gets moved around or its not in all pups.
Its not essential for scripts usually..I find its needed if running from a virtual terminal or remotely via ssh Thats mainly as puppys boot structure leaves you in a strange place in linux terms and there is no shutdown binary..nohup gets you through that rather than ending up in an endless loop or messing up saving.
mike
Its not essential for scripts usually..I find its needed if running from a virtual terminal or remotely via ssh Thats mainly as puppys boot structure leaves you in a strange place in linux terms and there is no shutdown binary..nohup gets you through that rather than ending up in an endless loop or messing up saving.
mike
As mike says - there are potentially differences between pups. I use a Slacko 5.6 derivative and have just successfully tried changing the last line like this:dcc701 wrote:However I tried changing your last line
exec /bin/busybox poweroff
to
exec /bin/nohup busybox poweroff
and it didn't work.
Code: Select all
exec nohup busybox poweroff
Worth a try anyway.
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!
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!
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)dcc701 wrote:This worked, but it somehow disabled rc.shutdown's asktosave function,
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.
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
I suppose choosing the fast shutdown would effectively be the choice and not saving is part of that...
mike
Such fast shutdown only come into play if I manage to make the system go crosseyed experimenting
I suppose choosing the fast shutdown would effectively be the choice and not saving is part of that...
mike
rc.shutdown mod for tahrpup 6.0.2
If you want to implement the original concept in Tahrpup 6.0.2, try the following:
In rc.shutdown replacewithLater 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
In rc.shutdown replace
Code: Select all
if [ "$ASKTOSAVE" = "false" ]; then
RETVAL=0
else
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
Note: Use at your own risk. It's not tested since I usually run in PUPMODE=12, and this code does not apply.
gyro