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 Tue 20 Feb 2018, 08:01
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
Hot swapping of savefiles without reboot
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [19 Posts]   Goto page: 1, 2 Next
Author Message
snayak

Joined: 14 Sep 2011
Posts: 391

PostPosted: Mon 15 Jan 2018, 23:30    Post subject:  Hot swapping of savefiles without reboot  

Dear All,

Is it absolutely impossible to hot swap out a running save file from a running puppy? I think this will be a good idea.

Unlike windows, as we know. linux is best known for being no-appinstall-reboot-os. If we reboot puppy with a new save file to test installation of a package, then it feels little odd. Isn't it?

For an app install, can't we just
1. save session modifications till now to save file
2. swap it out, like sfs files
3. copy current save file for testing
4. swap in new save file
5. install app and test
6. if like, continue use it
7. if not, swap it out, discard, swap in old save file
8. continue with old savefile

Since save files are *.ext4 files, I think it should be possible. But not sure if some technical details make it impossible. Kindly correct me.

Sincerely,
Srinivas Nayak

_________________
[Precise 571 on AMD Athlon XP 2000+ with 512MB RAM]
[Fatdog 611 on Intel Pentium B960 with 4GB RAM]

Home: http://www.mathmeth.com/sn/
Blog: http://srinivas-nayak.blogspot.com/
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 827

PostPosted: Mon 15 Jan 2018, 23:41    Post subject:  

I think if you're in ram mode and you shut down all processes that relied on the save file and turned off the auto save feature in the event manager, then it should be possible.

Alternatively you could just mount the save file as a loop device and copy it to an sfs file.

I think we have to be careful if we are running applications that are symbolically linked from the save file to also shut down these.

As a side note, if we are running in multi-save mode (like from a CD) then we would have less to unmount so this could work better.

Simple solution, maybe run in ram mode. Turn off event manager auto-save. Then copy save file. Turn auto-save back and make changes.

I think this would work but I would like someone with more expertise then me to confirm it.

Edit:

I just saw mikeslr poster how to backup a safe file. I might be helpful to this discussion:
http://murga-linux.com/puppy/viewtopic.php?p=974066#974066
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Tue 16 Jan 2018, 00:33    Post subject:  

Hi guys.

Late forum member mikeb was able to hot swap pupsave files. (Remembering your
good work and your good spirit, mikeb...) I was less experienced then, and I did
not understand fully how he was doing it.

I vaguely remember that he first had to be in console, and out of any dir. related
to /initrd. Then he substituted (???) the contents of the existing /initrd/pup_rw with
that of the pupsave file he wanted to use? I can't remember how he did it exactly,
but he did not have to reboot to change pupsaves.

Pardon the bad pun, but "Puppy was putty" in his hands. The best, of course,
would be to find his instructions in this bazaar of a forum... Wink

IHTH.

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3142
Location: The Blue Marble

PostPosted: Tue 16 Jan 2018, 01:28    Post subject:  

@s243a: You are indeed, very very close to the truth.

musher0 wrote:
Late forum member mikeb ...

"Late"? Shocked When did he pass away? Do you know this for sure, or is this just your assumption because he hasn't shown up in the forum for a while now?

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Tue 16 Jan 2018, 01:38    Post subject:  

jamesbond wrote:
@s243a: You are indeed, very very close to the truth.

musher0 wrote:
Late forum member mikeb ...

"Late"? Shocked When did he pass away? Do you know this for sure, or is this just your assumption because he hasn't shown up in the forum for a while now?

Hi jamesbond.

Member Mike_Walsh announced it in the forum a while ago...

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
mfb

Joined: 22 Mar 2016
Posts: 39

PostPosted: Tue 16 Jan 2018, 01:49    Post subject:  

musher0 is frequently mistaken:

mikeb has posted on this forum twice this month.

The adage goes: better late than never, but better never late.

EDIT:

It is reportedly proven, by accomplished scholars, that the phrase “entia non sunt multiplicanda praeter necessitatem” (whether translated into English, French or Canadian French) does not actually emanate from Ockham.

Even so, though doubtless Ockham would agree (to avoid compounding yet another error), it seems infallible logic that hot swapping may introduce an extraneous variable.

Last edited by mfb on Tue 16 Jan 2018, 04:48; edited 1 time in total
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Tue 16 Jan 2018, 02:36    Post subject:  

mfb wrote:
musher0 is frequently mistaken:

mikeb has posted on this forum twice this month.
(...)
Do proper legwork, mfb. The way you're operating now, you're just selling wind.

@cthisbear:
Remember this?(hehe)
http://murga-linux.com/puppy/viewtopic.php?p=888639&sort=lastpost&search_id=1125713849#888639

In any case, this forum's log shows a lapse of +/- 2.25 years for mikeb. (Please see
attached.) As for me, I consider Mike Walsh to be a trustworthy source. Perhaps he
was mistaken in sharing the info he shared, and I believed him. Those things happen.

~~~~~~~
It would be nice if the real mikeb would show up and provide info on the question at
hand? He could even dispel a few misunderstandings if he felt like it?

BFN.
mikeb-absence.jpg
Description 
jpg

 Download 
Filename  mikeb-absence.jpg 
Filesize  92.41 KB 
Downloaded  44 Time(s) 

Last edited by musher0 on Tue 16 Jan 2018, 02:54; edited 1 time in total
Back to top
View user's profile Send private message 
mfb

Joined: 22 Mar 2016
Posts: 39

PostPosted: Tue 16 Jan 2018, 02:47    Post subject:  

@snayak

In case it may help:

Pupmode 13 is used by USB drives, but a hard drive may be forced to use Pupmode 13 by adding “pmedia=ataflash” to the initrd boot config line.

Then, to obviate any need to hot swap, installing pupsaveconfig from the PPM (if available) and setting it as per the screen shot would allow a save (if happy), but no save (if unhappy).

PS musher0 was also mistaken about 666philb's leave of absence last year.
snap(1).jpg
 Description   
 Filesize   22.36 KB
 Viewed   460 Time(s)

snap(1).jpg

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


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

PostPosted: Tue 16 Jan 2018, 03:16    Post subject:  

mfb wrote:
@snayak

In case it may help:

Pupmode 13 is used by USB drives, but a hard drive may be forced to use Pupmode 13 by adding “pmedia=ataflash” to the initrd boot config line.

Then, to obviate any need to hot swap, installing pupsaveconfig from the PPM (if available) and setting it as per the screen shot would allow a save (if happy), but no save (if unhappy).

PS musher0 was also mistaken about 666philb's leave of absence last year.

It does not help. The OP asked how to do a hot swap of pupsave files, not how to obviate it.

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
mfb

Joined: 22 Mar 2016
Posts: 39

PostPosted: Wed 17 Jan 2018, 16:05    Post subject:  

Here are a couple of screen shots from earlier today:
snap(1).png
 Description   
 Filesize   228.73 KB
 Viewed   335 Time(s)

snap(1).png

snap.png
 Description   
 Filesize   178.86 KB
 Viewed   335 Time(s)

snap.png

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


Joined: 21 Sep 2011
Posts: 973
Location: Bs.As. - Argentina.

PostPosted: Wed 17 Jan 2018, 16:29    Post subject:  

musher0 wrote:
jamesbond wrote:
@s243a: You are indeed, very very close to the truth.

musher0 wrote:
Late forum member mikeb ...

"Late"? Shocked When did he pass away? Do you know this for sure, or is this just your assumption because he hasn't shown up in the forum for a while now?

Hi jamesbond.

Member Mike_Walsh announced it in the forum a while ago...


Are you talking about this mikeb?
http://murga-linux.com/puppy/viewtopic.php?p=980521#980521
Seems alive and kicking...

_________________
Remember: "pecunia pecuniam parere non potest"
Back to top
View user's profile Send private message 
mfb

Joined: 22 Mar 2016
Posts: 39

PostPosted: Fri 19 Jan 2018, 05:12    Post subject:  

Testily, musher0 wrote above:

Quote:

It does not help. The OP asked how to do a hot swap of pupsave files, not how to obviate it.


But,

(1) The OP, Srinivas Nayak, was awarded a computer science degree in 2004 and he is now in his 14th year working as a software engineer. Thus, it is hardly likely that he appointed musher0 as his spokesperson.

(2) I originally wrote and used a savefile-hot-swap when I operated in Pupmode=13 in conjunction with PupSaveConfig on another Pup. but that ceased to be of use - so I deleted it and I now only save when desired.

(3) The method outlined has a good chance of working well with Precise 5.7.1

(4) Excellent help would surely follow if the OP were to PM mikeb (whom, as I informed musher0, is not deceased - though, typically, musher0 issued no apology for his most serious error.)

As an aside, since he enjoys reading philosophy, Srinivas may like to add a comment of his own concerning Ockham.

Finally, two days ago in another thread, to another OP - musher0 wrote "Nobody will help you ..."
whether that was a reckless forecast or yet another rude instruction - it was soon broken.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1449
Location: Japan

PostPosted: Fri 19 Jan 2018, 10:46    Post subject: Re: Hot swapping of savefiles without reboot  

snayak wrote:
Is it absolutely impossible to hot swap out a running save file from a running puppy? I think this will be a good idea.
I don't use a save file so I may not be qualified to judge your idea, but I don't see why this would be useful.
Quote:
For an app install, can't we just
1. save session modifications till now to save file
OK, this we can, provided we are in PUPMODE 13 with its periodic save option

Quote:
2. swap it out, like sfs files
3. copy current save file for testing

I hope you don't mean it Laughing
Some forum members accumulate huge save files several GB in size, we don't want to copy these just for testing, do we? More important than the save file is the ramdisc (pup_rw) as all stuff from the test installation would be buffered in the ramdisc. Ideally the session saving in 1. would have flushed the ramdisc. Then with a clean ramdisc we could do the test installation and , if we don't like the result, conventionally delete all files from pup_rw and undo the installation. Unfortunately saving a session to the save file does not clean the ramdisc. I assume that it is also not possible to swap out the ramdisc and replace it with a clean and fresh one since this would be the same as flushing and, if possible, would have been implemented by BK when he designed the layer concept.

I think with the periodic save option we have a good basis for undoable installations.
First there is the conventional uninstall process which normally works well and leaves no traces.
If the installation trashes the system or has other unwanted effects we still have the option to reboot without save (may require to switch to PUPMODE 5). Very simple and no swapping involved.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 827

PostPosted: Fri 19 Jan 2018, 11:25    Post subject:  

As an aside, the sandbox.sh available in fatdog64 may provide some of the functionality that the original poster wants, albiet by slightly different means.
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3142
Location: The Blue Marble

PostPosted: Fri 19 Jan 2018, 13:21    Post subject:  

Galbi wrote:
Are you talking about this mikeb?
http://murga-linux.com/puppy/viewtopic.php?p=980521#980521
Seems alive and kicking...


Yes, I was. Thank you for the info, I'm glad he's still okay.

@s243a: indeed, sandbox.sh (especially rw-sandbox.sh) may be what snayak needs.

_______________


As for the original question:

The ability to hot-swap the save layer is related to a long running question in puppy - how to perform clean shutdown. In fact it's identical - you can only perform clean shutdown is you can dismount the currently used save layer. If you can remove it, then you can mount it again (or mount something else in its place) and restart everything, instead of rebooting. And since we can do clean shutdown, then obviously (or not so obviously) we can perform save-layer hotswap.

It has been a long time since I look at my shutdown script, but this thread intrigued me so I did a few tests and re-traced my path I took when I wrote that shutdown script years ago.

And the result of the experiment is this: the answer is an absolute YES YOU CAN. You don't even need to run using the RAM layer (aka pupmode=13) if your play your cards right. Once you take the savelayer out, you can replace it with anything (including, for example, an empty tmpfs layer - I'm posting from one of the experiments right now).

The practicality of doing this doubt-able, though - because you need to shutdown the graphical desktop, most of the services, etc to unlock the save layer; then take it out; then replace it with another save layer, then restart the services, then restart the graphical desktop. This level of disruption is close to doing a full reboot - so the only benefit of doing this is if you want to avoid a total reboot (e.g. your power-up sequence is slow).

It is still fun to test the limits of aufs, though Laughing

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [19 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
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.0930s ][ Queries: 15 (0.0127s) ][ GZIP on ]