Discussion:
Nested systemd
(too old to reply)
Boyce, Kevin P [US] (AS)
2017-12-11 20:14:50 UTC
Permalink
Good Afternoon List,

I have a question regarding the use of systemd. I would like to know if it is possible to have two instances of system running at a time?

For instance I have an application that has a very complicated set of startup procedures. It runs on linux. I was considering using an instance of systemd with some custom unit files and targets as a self-contained startup procedure. I was wondering if systemd could then start this systemd instance using an alternate root directory?

Apologies if this is the wrong area to ask.

Kind Regards,
Kevin
Boyce, Kevin P [US] (AS)
2017-12-11 20:40:55 UTC
Permalink
Good Afternoon List,

Does anyone know if it is possible to have two instances of system running at a time?

For instance I have an application that has a very complicated set of startup procedures. It runs on linux. I was considering using an instance of systemd with some custom unit files and targets as a self-contained startup procedure. I was wondering if systemd could then start this systemd instance using an alternate root directory?

Apologies if this is the wrong area to ask.

Kind Regards,
Kevin
Mantas Mikulėnas
2017-12-11 21:33:53 UTC
Permalink
On Mon, Dec 11, 2017 at 10:14 PM, Boyce, Kevin P [US] (AS) <
Post by Boyce, Kevin P [US] (AS)
Good Afternoon List,
I have a question regarding the use of systemd. I would like to know if
it is possible to have two instances of system running at a time?
For instance I have an application that has a very complicated set of
startup procedures. It runs on linux. I was considering using an instance
of systemd with some custom unit files and targets as a self-contained
startup procedure. I was wondering if systemd could then start this
systemd instance using an alternate root directory?
Your description sounds almost exactly like what containers
(systemd-nspawn, LXC, Docker) are normally used for – including both the
nested init system and the alternate root directory. Systemd should work
just fine when used as a container init process.

But beyond that, systemd only supports *one* "system mode" instance per
system – that is, PID 1.

(It *does* support unprivileged "user mode" instances of `systemd --user`,
limited to one per UID, but I'm not sure if these are suitable for
"complicated startup procedures" in your case.)
--
Mantas Mikulėnas <***@gmail.com>
Loading...