SFS unloader

Miscellaneous tools
Post Reply
Message
Author
User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

SFS unloader

#1 Post by greengeek »

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!
.
Attachments
all_sfs_unloader_gg-0.0.pet
(6.74 KiB) Downloaded 188 times
Last edited by greengeek on Thu 12 Apr 2018, 20:23, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hi greengeek.

Good idea. (I'm in a rush; back later for more substantial comment.)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

#3 Post by drunkjedi »

I actually never observed any problems while shutting down.
I too load many sfs and run without save.
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?
I will look closely at next shutdown.

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

#4 Post by greengeek »

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?
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).

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

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#5 Post by musher0 »

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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

#6 Post by greengeek »

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.
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.

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.

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

#7 Post by gyro »

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).
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
gyro

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#8 Post by bigpup »

I got rid of the original shutdown script
Now you know it does more than you think.

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 :shock:
YaPI(any iso installer)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post by musher0 »

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 with

Code: Select all

kill -s 9 `pgrep program`
or

Code: Select all

killall -q program
You'll say "my way is not your way," and of course you will be right.

My 2¢.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

#10 Post by greengeek »

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
Thanks gyro - that probably would have been a better way for me to have modified my shutdown process.

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)
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!
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.
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...
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.

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
Yeah, I know, I have weird ways of doing stuff...

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#11 Post by musher0 »

Hi greengeek.

Ah, one has to obey his wife. ;) It's in one of St. Paul's Epistles, IIRC.
(Ephesians?)

I know. In years past, two commanded me. :lol: Fortunately, divorce
happened. :D
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

#12 Post by greengeek »

musher0 wrote:I know. In years past, two commanded me. :lol: Fortunately, divorce happened. :D
8) 8) 8)
Just one divorce for me (so far!)
Puppy is my true love
:twisted:

hamoudoudou

they are here, in tmpfs..

#13 Post by hamoudoudou »

"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)

riedzig
Posts: 40
Joined: Thu 01 Oct 2015, 06:14

#14 Post by riedzig »

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.

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

#15 Post by greengeek »

Thanks reidzig - Rainers work was very interesting. I like the idea of a builtin auto-unloader. I will have a closer look at his work on that.

Post Reply