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 Wed 12 Dec 2018, 21:29
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
SFS unloader
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [15 Posts]  
Author Message
greengeek


Joined: 20 Jul 2010
Posts: 5329
Location: Republic of Novo Zelande

PostPosted: Thu 12 Apr 2018, 05:39    Post subject:  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!
.
all_sfs_unloader_gg-0.0.pet
Description 
pet

 Download 
Filename  all_sfs_unloader_gg-0.0.pet 
Filesize  6.74 KB 
Downloaded  118 Time(s) 

Last edited by greengeek on Thu 12 Apr 2018, 16:23; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13159
Location: Gatineau (Qc), Canada

PostPosted: Thu 12 Apr 2018, 14:38    Post subject:  

Hi greengeek.

Good idea. (I'm in a rush; back later for more substantial comment.)

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
drunkjedi


Joined: 24 May 2015
Posts: 897

PostPosted: Thu 12 Apr 2018, 14:48    Post subject:  

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.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5329
Location: Republic of Novo Zelande

PostPosted: Thu 12 Apr 2018, 15:17    Post subject:  

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)
pmount_error.jpg
 Description   
 Filesize   29.23 KB
 Viewed   245 Time(s)

pmount_error.jpg

Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13159
Location: Gatineau (Qc), Canada

PostPosted: Sat 14 Apr 2018, 17:37    Post subject:  

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" Wink (F9) with this or that program.

BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5329
Location: Republic of Novo Zelande

PostPosted: Sat 14 Apr 2018, 21:26    Post subject:  

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" Wink (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.
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1558
Location: Brisbane, Australia

PostPosted: Sat 14 Apr 2018, 22:01    Post subject:  

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:
#!/bin/sh

echo "PUPMODE=5" > /tmp/shutdownconfig_results

exit
gyro
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 11375
Location: S.C. USA

PostPosted: Sat 14 Apr 2018, 23:36    Post subject:  

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

_________________
I have found, in trying to help people, that 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 Shocked
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13159
Location: Gatineau (Qc), Canada

PostPosted: Sun 15 Apr 2018, 02:34    Post subject:  

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:
kill -s 9 `pgrep program`
or
Code:
killall -q program

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

My 2¢.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5329
Location: Republic of Novo Zelande

PostPosted: Sun 15 Apr 2018, 15:16    Post subject:  

gyro wrote:
Maybe it would be better to reinstate the original shutdown script and then replace /usr/sbin/shutdownconfig with the following:
Code:
#!/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.

Quote:
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:
#!/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...
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13159
Location: Gatineau (Qc), Canada

PostPosted: Sun 15 Apr 2018, 18:40    Post subject:  

Hi greengeek.

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

I know. In years past, two commanded me. Laughing Fortunately, divorce
happened. Very Happy

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5329
Location: Republic of Novo Zelande

PostPosted: Mon 16 Apr 2018, 04:53    Post subject:  

musher0 wrote:
I know. In years past, two commanded me. Laughing Fortunately, divorce happened. Very Happy
Cool Cool Cool
Just one divorce for me (so far!)
Puppy is my true love
Twisted Evil
Back to top
View user's profile Send private message 
hamoudoudou

Joined: 24 Jul 2014
Posts: 1467
Location: rabat

PostPosted: Sat 21 Apr 2018, 23:01    Post subject: 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)
Back to top
View user's profile Send private message 
riedzig

Joined: 01 Oct 2015
Posts: 34

PostPosted: Sun 22 Apr 2018, 02:06    Post subject:  

I have found an interestic idea "AutoUnload SFS"
http://murga-linux.com/puppy/viewtopic.php?t=82762&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.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5329
Location: Republic of Novo Zelande

PostPosted: Sun 22 Apr 2018, 08:08    Post subject:  

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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [15 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
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.0687s ][ Queries: 15 (0.0104s) ][ GZIP on ]