See section "Providing a complete init system"
here for a model for describing init system components. Then read on.
sysvinit + OpenRC the way Gentoo sets it up: Components 1, 2 3 are implemented by the
init program from the sysvinit package, component 4, the service manager, is implemented by the OpenRC package, and
init is
configured for delegating to it.
"pure OpenRC" (as I prefer to call it): Components 1 and 2 are implemented by OpenRC's
openrc-init program, component 3 is implemented by OpenRC's
supervise-daemon program, and the rest is the same.
Because the service manager is the most visible part for the user, and it is the same in both setups, there isn't much difference between them. Except for one thing: the handling of the
agetty processes, the ones that allow you to log in to the computer and get a text user interface (TUI) for interacting with it.
agetty processes terminate when you log out, so they have to be restarted for allowing you to log in again. This is handled by component 3, the process supervisor. For a "pure OpenRC" setup, this is taken care of by symlinks to
the agetty service in the appropriate runlevel. The service then relies on
supervise-daemon:
For Gentoo's sysvinit + OpenRC setup, this is taken care of by
init itself:
/etc/inittab
Code: Select all
c1:12345:respawn:/sbin/agetty --noclear 38400 tty1 linux
c2:2345:respawn:/sbin/agetty 38400 tty2 linux
...
The "respawn" action tells
init to restart
agetty when it terminates.
There is a theoretical
disadvantage for the "pure OpenRC" setup: the supervisors are regular processes that can terminate, and nobody will restart them, leaving the processes that they care about unsupervised, while, in contrast, for the sysvinit + OpenRC setup, the supervisor is process 1, which is "indestructible".
Well, not really, but if it terminates, the whole computer goes down with a kernel panic, so PID 1 program (component 2) authors are supposed to do their best to prevent that. You could say that staying alive is pretty much one of the PID 1 program's important job descriptions 