LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Bedrock Linux (https://www.linuxquestions.org/questions/bedrock-linux-118/)
-   -   Swap distro without reboot? (https://www.linuxquestions.org/questions/bedrock-linux-118/swap-distro-without-reboot-4175614803/)

elypter 09-30-2017 02:04 PM

Swap distro without reboot?
 
is it possible to switch the default strata and singletons to another distro and run the default applications without having to reboot? and is it possible to kexec reboot into another distro of the bedrock boot menu without manually selecting it?

ondoho 09-30-2017 02:10 PM

Quote:

Originally Posted by elypter (Post 5764871)
is it possible to switch the default strata and singletons to another distro and run the default applications without having to reboot? and is it possible to kexec reboot into another distro of the bedrock boot menu without manually selecting it?

that's an interesting language you are using there, not sure if it is english.
anyhow on "bare metal" you need to reboot to use another distro, but i believe there's virtualisation techniques that might fulfil your needs.

!!! 09-30-2017 03:06 PM

Can a *bedrock distro expert* advise further here???
 
@Bedrock Linux's 3LQpeople ... (they may be busy &take a day+ to find nonZRT)

Welcome to LQ, elypter!!! Sounds like you may have some ?grad school? concepts there, but tell us a bit more.
Try a word different than strata: it has geological meaning, but my web-researching it with "OS" found nothing.
Your 2nd word is found with OOprogramming. kexec mentions the syscall exec: have you used it? (how?) I assume you are using http://DistroWatch.com/bedrock

Cool:cool: features:all 'init systems'!!! Maybe it has a way to kexec...
Note that a 'distro' is basically some one/team's kernel .config plus choice of software (init, pkg-mgr, DE/WM/'apps', other customizations); see DWsearch

What hostOS/PC do you currently use? A tiny bit of info on your Linux experience/goals, might help us also.
You can, in just minutes, on M$WinX/Linux/MacOS, run Linux guest VMs (js heavy link) in VirtualBox
to experiment and (try to) experience all this. Best wishes; let us know more.

p.s. You also might look into 'containers' (used in Cloud technology, but I don't know such).
Cool instantaneous triage in #2!!! (2=3-1) I gave it a "raiep" ;)

ParadigmComplex 09-30-2017 07:02 PM

Quote:

Originally Posted by elypter (Post 5764871)
is it possible to switch the default strata and singletons to another distro and run the default applications without having to reboot? and is it possible to kexec reboot into another distro of the bedrock boot menu without manually selecting it?

I'm not entirely sure what you're asking, but I'll offer something. If it doesn't answer your question, feel free to rephrase or go into more detail.
  • Bedrock Linux tries to let you run as much as is possible in parallel and, where that fails, hot swap as much as possible, and where that fails, swap as much as possible with a reboot. However, there are limits to what it can do, namely the singletons that you've mentioned. If there's a limit here, it's probably because we don't know of a way to do this cleanly, rather than some design goal.
  • I don't know what you mean by "default applications", but my guess is that Bedrock will *probably* let you run those from a variety of distros without a reboot in between, provided they're not dependent on some non-hot-swap'able singleton. If multiple strata provide some feature, there are ways to specify which is desired, including configuration specifying a default. Typically if I run `firefox` I'll get Firefox from one stratum, but I can reconfigure it so next time I run `firefox` I'll get Firefox from a different stratum, or I can always run `brc <stratum> firefox` to specify which stratum I want to provide Firefox on the fly. Provided I use `-remote` (due to a Firebox quirk, not necessarily representative of all applications), I can run multiple instances of Firefox in parallel from different strata.
  • I'm not as familiar with kexec as I should be. If it'll let you hot swap the kernel on some other distro, it'll probably let you do that with Bedrock Linux. I've never personally tried this, and I've never heard reports from those who have. If you give it a try, do let me know so I can make note of it for others. Bedrock Linux does not provide any special magicks to make hot swapping kernels possible.
  • Independent of Bedrock, it is possible in theory to hot swap init systems, if the init system supports it. I've written toy init systems which do this. However, I don't think most major init systems support this. Bedrock Linux does not provide any special magicks to make hot swapping init systems possible.

Quote:

Originally Posted by ondoho (Post 5764874)
anyhow on "bare metal" you need to reboot to use another distro, but i believe there's virtualisation techniques that might fulfil your needs.

The idea behind Bedrock Linux is to let you get features from other distros at the same time, working together, without the overhead of virtualization. You can hot swap quite a bit of the system without rebooting. You can run a DE from one distro and swap it to a DE from another distro without a reboot, for example. Or run both DEs at the same time.

Quote:

Originally Posted by !!! (Post 5764891)
Try a word different than strata: it has geological meaning, but my web-researching it with "OS" found nothing.
Your 2nd word is found with OOprogramming.

Both "strata" and "singleton" are well defined within the context of Bedrock Linux. If you query a search engine for "bedrock linux strata" or "bedrock linux singleton" it should direct you accordingly, but in case they don't, the relevant web page to read is here.

ondoho 10-01-2017 01:22 AM

^ thanks for the clarification.
i also see this thread has been moved to the appropriate subforum.

ParadigmComplex 10-01-2017 06:16 AM

Quote:

Originally Posted by ondoho (Post 5764962)
^ thanks for the clarification.
i also see this thread has been moved to the appropriate subforum.

I didn't realize it was in another subforum before I got to it. That would explain some of the confusion in the responses! Apologies if my tone came out wrong. I was confused why people were confused.

elypter 10-02-2017 10:03 AM

sorry for the confusion. i came from the bedrock linux website but i must have been redirected without noticing, maybe during login.


Quote:

Bedrock Linux tries to let you run as much as is possible in parallel and, where that fails, hot swap as much as possible, and where that fails, swap as much as possible with a reboot. However, there are limits to what it can do, namely the singletons that you've mentioned. If there's a limit here, it's probably because we don't know of a way to do this cleanly, rather than some design goal.
i should first explain what i am trying to do. i was unsatisfied with the shutdown dialog my de provided so i decided to write an expert gui shutdown dialog that offers every possible way shut down, reboot, suspend or log out. i researched quite a bit of stuff and i also remembered bedrock linux and its advantage of not having to reboot for many use cases. so i asked myself if you could implement some sort of pseudo reboot. this is not really limited by a specific use case but just by what users could find useful.
Quote:

I don't know what you mean by "default applications", but my guess is that Bedrock will *probably* let you run those from a variety of distros without a reboot in between, provided they're not dependent on some non-hot-swap'able singleton. If multiple strata provide some feature, there are ways to specify which is desired, including configuration specifying a default. Typically if I run `firefox` I'll get Firefox from one stratum, but I can reconfigure it so next time I run `firefox` I'll get Firefox from a different stratum, or I can always run `brc <stratum> firefox` to specify which stratum I want to provide Firefox on the fly. Provided I use `-remote` (due to a Firebox quirk, not necessarily representative of all applications), I can run multiple instances of Firefox in parallel from different strata.
one of the ideas of how a pseudo reboot could look like was to look at the difference between the booted distro and the one that should be "booted" and then unload whats not in the new one and load what has not been loaded yet. i know this could be tricky but maybe it is possible if both use the same init system. another way could be to load everything the new system would load as long as it doesnt run into conflicts. i dont know if it is possible to just extract those bits of information out of an init system and excecute it without having a high probability of breaking stuff but maybe there is a method to do this in a limited but safe way.
Quote:

I'm not as familiar with kexec as I should be. If it'll let you hot swap the kernel on some other distro, it'll probably let you do that with Bedrock Linux. I've never personally tried this, and I've never heard reports from those who have. If you give it a try, do let me know so I can make note of it for others. Bedrock Linux does not provide any special magicks to make hot swapping kernels possible.
i use a program called kexec-reboot on linux mint and it works quite well. it doesnt just swap the kernel but the whole system which should be a lot easier. this cuts down reboot time by skipping bios. i thought that if none of the pseudo reboots work or if you want a full reboot this would be the fastest way. i thought it would be handy if you could select one of the distros in the bedrock boot list in the shutdown dialog already and then just hit reboot and come back when the new system has booted up.
Quote:

Independent of Bedrock, it is possible in theory to hot swap init systems, if the init system supports it. I've written toy init systems which do this. However, I don't think most major init systems support this. Bedrock Linux does not provide any special magicks to make hot swapping init systems possible.
thats quite interesting

ParadigmComplex 10-03-2017 03:54 PM

Quote:

Originally Posted by elypter (Post 5765403)
sorry for the confusion. i came from the bedrock linux website but i must have been redirected without noticing, maybe during login.

No worries, it looks like it was all sorted out.

Quote:

Originally Posted by elypter (Post 5765403)
i should first explain what i am trying to do. i was unsatisfied with the shutdown dialog my de provided so i decided to write an expert gui shutdown dialog that offers every possible way shut down, reboot, suspend or log out.

Interesting. That's where the kexec-reboot came into play - another option to include into the mix.

Quote:

Originally Posted by elypter (Post 5765403)
i researched quite a bit of stuff and i also remembered bedrock linux and its advantage of not having to reboot for many use cases. so i asked myself if you could implement some sort of pseudo reboot. this is not really limited by a specific use case but just by what users could find useful.

I'm blanking on the use cases you're considering here. My only guess: Bedrock Linux can let you install or remove what would normally be the entirety of a distro's files. What for other distros would have been a reinstall (which includes a reboot) can be done live with Bedrock.

Quote:

Originally Posted by elypter (Post 5765403)
one of the ideas of how a pseudo reboot could look like was to look at the difference between the booted distro and the one that should be "booted" and then unload whats not in the new one and load what has not been loaded yet.

Provided I am following you correctly, many init systems provide a feature that does this. It's usually called something like "runlevels" or "targets". Provided your init is adequately featureful, you should be able to make various, different sets of services you want and switch between them. You'll have to see your preferred init's documentation.

Quote:

Originally Posted by elypter (Post 5765403)
i know this could be tricky but maybe it is possible if both use the same init system. another way could be to load everything the new system would load as long as it doesnt run into conflicts. i dont know if it is possible to just extract those bits of information out of an init system and excecute it without having a high probability of breaking stuff but maybe there is a method to do this in a limited but safe way.

Getting init systems to coordinate across strata is in the scope of what Bedrock Linux is trying to do. I've put quite a bit of thought here. If we ever get that to work perfectly, you could use runlevels/targets/etc to get your pseudo reboot. However, it looks like it'll be a lot of work. Moreover, there's a good chance I don't come up with an adequately reliable solution and all the R&D effort goes to waste. For the foreseeable future, I'd rather invest the available resources elsewhere.

The plan right now is to have people to use their distro's configs for their init then hand write configuration for services in other strata. Making a daemontools service directory or systemd unit file that calls out to something in another stratum is quite doable. It's on the person hand writing the configuration to avoid potential conflicts. In theory you could make such configuration for each and every service you're interested in and make runlevels/targets/etc and get the desired goal, but it'll be a lot of work.

Quote:

Originally Posted by elypter (Post 5765403)
i use a program called kexec-reboot on linux mint and it works quite well. it doesnt just swap the kernel but the whole system which should be a lot easier. this cuts down reboot time by skipping bios.

That's pretty cool. Now that it is pointed out to me, it makes sense that something like this should be possible, but I've never thought about it before.

Quote:

Originally Posted by elypter (Post 5765403)
i thought that if none of the pseudo reboots work or if you want a full reboot this would be the fastest way. i thought it would be handy if you could select one of the distros in the bedrock boot list in the shutdown dialog already and then just hit reboot and come back when the new system has booted up.

As I understand kexec-reboot, there's no reason it couldn't be used to reboot to the menu where you pick which stratum's init to use right now.

Going forward, I should be able to add a feature to specify the preferred stratum/init via a kernel line parameter that kexec-reboot could set which would let you pick the init at a reboot dialogue. That shouldn't be hard at all. Provided I don't forget, this will be supported in the next release.

Quote:

Originally Posted by elypter (Post 5765403)
thats quite interesting

Conceptually it's very similar to kexec, just for the init. Optionally stop all the services, then simply call one of the exec system calls (e.g. execvp) on the desired new init executable. If more inits supported this, it would be exactly what you wanted. However, the init system landscape is... politically divisive, and I fear we're unlikely to see such efforts.


All times are GMT -5. The time now is 01:30 AM.