SFS unloader
SFS unloader
When I shutdown my puppy it gets it's knickers in a twist if there are still sfs files loaded.
Problem is - I can't always remember which sfs files I have been using, so I needed a way to ensure that all sfs files get unloaded regardless of what they were or when they were loaded.
Attached is a .pet which will load a script into the /root directory.
(EDIT : based on code written by forum member seaside)
Simply click that script before shutting down and all sfs files will be unloaded.
CAUTION: I run my puppy in "live mode" with no savefile so i just load this pet when I need it (It gets dumped at shutdown). If you run with a savefile please make a savefile backup and/or hide the savefile and run without it while you test if this pet is useful to you. (No point having it permanently grafted into your savefile if you don't like it)
cheers!
.
Problem is - I can't always remember which sfs files I have been using, so I needed a way to ensure that all sfs files get unloaded regardless of what they were or when they were loaded.
Attached is a .pet which will load a script into the /root directory.
(EDIT : based on code written by forum member seaside)
Simply click that script before shutting down and all sfs files will be unloaded.
CAUTION: I run my puppy in "live mode" with no savefile so i just load this pet when I need it (It gets dumped at shutdown). If you run with a savefile please make a savefile backup and/or hide the savefile and run without it while you test if this pet is useful to you. (No point having it permanently grafted into your savefile if you don't like it)
cheers!
.
- Attachments
-
- all_sfs_unloader_gg-0.0.pet
- (6.74 KiB) Downloaded 191 times
Last edited by greengeek on Thu 12 Apr 2018, 20:23, edited 1 time in total.
I got rid of the original shutdown script because it kept asking me if I wanted to create a save file (I don't ever use a savefile).drunkjedi wrote:Isn't this the job of shutdown script to stop running programs and unload any loaded sfs files?
What kind of "twisted knickers" you observed?
The behaviour I see is that pmount won't release a drive if that drive contains a mounted sfs. I get an error message about the kernel hanging onto the drive and puppy not wanting to shut it down (see attached)
Unfortunately, with my memory being not as good as it once was (ie MY memory, not my PC ram) I can't remember how many sfs files I have loaded or what they were - or on which drives they resided.
Hence the little unload utility with it's gorgeous icon in /root
(musher may not see my lovely icon as it needs jwm i think)
- Attachments
-
- pmount_error.jpg
- (29.23 KiB) Downloaded 278 times
Hi greengeek.
I looked at your script. Since I'm not familiar with mount / unmount
sequences, it looks like Martian to me.
That said: are you sure the sfs' are the slowpokes, and not some program
taking its own sweet time to quit?
The latter happens to me sometimes. Then I use htop to do some
"convincing" (F9) with this or that program.
BFN.
I looked at your script. Since I'm not familiar with mount / unmount
sequences, it looks like Martian to me.
That said: are you sure the sfs' are the slowpokes, and not some program
taking its own sweet time to quit?
The latter happens to me sometimes. Then I use htop to do some
"convincing" (F9) with this or that program.
BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
It's definitely to do with the fact that the sfs is still loaded - regardless of whether or not it is still i use. I wouldn't have a problem if I had stuck with the original shutdown programme I guess, but it didn't suit me.musher0 wrote:That said: are you sure the sfs' are the slowpokes, and not some program taking its own sweet time to quit?
The latter happens to me sometimes. Then I use htop to do some
"convincing" (F9) with this or that program.
I don't know if you remember - it's going back a few years now - but you wrote a script for me that unmounted drives and shut the PC down quickly. I gave no thought at that time to unloading sfs files and in fact I almost never use them - preferring to use .pets instead.
Just mostly if I use the devx.sfs i get into strife at shutdown time, hence the unloader script.
I did try to convert the devx sfs to a .pet once but failed to achieve it. Can't remember what the issue was but I will go back to it at some point.
Maybe it would be better to reinstate the original shutdown script and then replace /usr/sbin/shutdownconfig with the following:greengeek wrote:I got rid of the original shutdown script because it kept asking me if I wanted to create a save file (I don't ever use a savefile).
Code: Select all
#!/bin/sh
echo "PUPMODE=5" > /tmp/shutdownconfig_results
exit
Now you know it does more than you think.I got rid of the original shutdown script
Just modify it to not ask about the save.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
Hi greengeek.
IMHO, pup_ro2 (the main puppy sfs) and the pup_z (zdrv) need to stay
up until the end. Why kill them? They'll do harakiri in a couple of seconds
anyway, this is the poweroff script!
Also I personally do not like this unmount-the-sfs approach. IMO it's
overkill. I would try to find what program is creating the bottleneck and
end that program withor
You'll say "my way is not your way," and of course you will be right.
My 2¢.
IMHO, pup_ro2 (the main puppy sfs) and the pup_z (zdrv) need to stay
up until the end. Why kill them? They'll do harakiri in a couple of seconds
anyway, this is the poweroff script!
Also I personally do not like this unmount-the-sfs approach. IMO it's
overkill. I would try to find what program is creating the bottleneck and
end that program with
Code: Select all
kill -s 9 `pgrep program`
Code: Select all
killall -q program
My 2¢.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Thanks gyro - that probably would have been a better way for me to have modified my shutdown process.gyro wrote:Maybe it would be better to reinstate the original shutdown script and then replace /usr/sbin/shutdownconfig with the following:Code: Select all
#!/bin/sh echo "PUPMODE=5" > /tmp/shutdownconfig_results exit
Unfortunately I am now locked in to my shutdown mods - and now that I think more about it, this issue is more to do with pmount than to do with the shutdown script.
As part of my shutdown process I manually unmount each storage drive - this is where the sfs problem comes in. Pmount does not seem able to release the sfs.
Do other people have that same problem with pmount? (I have no desktop drive icons - another of my mods - so i have to summon pmount to control mounting and unmounting)
As far as I am aware thse sfs files are a special case - they are not mounted as normal sfs files - they are unpacked into the tmpfs locations. Maybe I am misunderstanding this.musher0 wrote:IMHO, pup_ro2 (the main puppy sfs) and the pup_z (zdrv) need to stay up until the end. Why kill them? They'll do harakiri in a couple of seconds anyway, this is the poweroff script!
Some of my sfs don't contain programs - sometimes they are just TTF font files, or else .txt, .pdf and .doc files that form part of my reference archive (for coding shippets and similar stuff). Even if there are no active programs being run from the sfs it still causes pmount to spit the dummy.Also I personally do not like this unmount-the-sfs approach. IMO it's
overkill. I would try to find what program is creating the bottleneck and
end that program with...
I guess it seems odd to other people that I want to manually control my unmounting but I started doing it when I modified my shutdown process to shutdown super quickly if needed. For example if I am just browsing the web and my wife tells me to hurry up and get in the car I can shut down in 3 seconds using the following script:
Code: Select all
#!/bin/sh
#greengeek 2014May15 using code from MochiMoppel and Backi
# skips rc.shutdown and powers off computer without saving the session.
#Use at own risk as no attempt is made to unmount anything
#Although BanksyPup is not intended for mounting...
exec /bin/busybox poweroff
they are here, in tmpfs..
"As far as I am aware thse sfs files are a special case - they are not mounted as normal sfs files - they are unpacked into the tmpfs locations. Maybe I am misunderstanding this." greengeek, i think as you they are here, in tmpfs.. and as you i will not bet an old Franc on it. (a penny)
I have found an interestic idea "AutoUnload SFS"
http://murga-linux.com/puppy/viewtopic. ... 2&start=15
for those who don't like lots of loaded .sfs files within a session.
I have managed to adapt successfully his last "simple-run-script-d.gz" for many sfs files. It loads the sfs and autounloads it after exiting the app. So far I didn't find a way to use these scripts in Rox to Open with.
http://murga-linux.com/puppy/viewtopic. ... 2&start=15
for those who don't like lots of loaded .sfs files within a session.
I have managed to adapt successfully his last "simple-run-script-d.gz" for many sfs files. It loads the sfs and autounloads it after exiting the app. So far I didn't find a way to use these scripts in Rox to Open with.