Post by John AmesOn Fri, 6 Dec 2024 20:00:54 -0000 (UTC)
Post by Lawrence D'OliveiroPost by M***@DastardlyHQ.orgOn Thu, 5 Dec 2024 20:45:36 -0000 (UTC)
Post by Lawrence D'OliveiroWhat “single task” did init do?
Boot the system to usable state.
What would you say systemd does that is not related to that?
Networking, including DNS
Graphics
Logging
systemd-boot
Basically init should start the system, maintain some the running of
some essential daemons and then leave well alone.
On Solaris 10 and later, svc.startd does most spawning and respawning
and such, and uses a "contract" mechanism to be able to keep track of
and if needed kill off otherwise daemonized processes (sshd needs a
compile time option so it only kills the listening sshd and not the
children handling processes - which need to explicitly break their
"contract", otherwise an admin restarting sshd over ssh will kick
themselves out; but for the vast majority of other code, the contract
mechanism does what one might hope with no modification needed to the
code of what it controls)).
But it still has init, although init does little more than start or
control svc.startd (but you could configure it to start something
outside of the control of svc.startd if you really wanted to).
What's the point of svc.startd there? It with the relevant service
configuration files can handle dependencies among services (processes
or other actions) to be started, starting in parallel any whose
dependencies are satisfied; with sufficient hardware threads, that can
provide faster startup. And it can use the aforementioned contract
mechanism to stay more in control, and will fix simple things by
restarting, albeit not if they keep faulting too rapidly. It interacts
with fault management (which also deals with hardware issues) to
provide a consolidated handing of both daemon and hardware issues, for
greater fault tolerance.
For Solaris systems isolated enough that they didn't need regular security
updates, I've seen uptimes in years, so they're probably doing something
right (that they mostly have ECC RAM helps a lot, too). @home, I seldom
get those uptimes, in part because I don't have UPS for everything. :-)