3 ms·
Nothing written in C, or at least entirely in C, is a viable replacement for systemd. One big problem with systemd is the internals: all the stinky "char *" st
by kazinator 11y ago
Nothing written in C, or at least entirely in C, is a viable replacement for systemd.
One big problem with systemd is the internals: all the stinky "char *" string processing which is repeated all over the place and the badly greenspunned OO programming system that it contains and so forth.
The kinds of things that systemd does are best written in a high level language (of course, with suitable bindings for the system calls required).
Old SysVInit gets away with being written in C because it's small and simple and just handles the /etc/inittab, which has a simple format. Anything complicated is farmed out startup, shutdown and runlevel scripts.
The way to proceed was to add an extension language to init so that actions can be written in that language to do more kinds of things.
Perhaps the executable which runs as PID 1 can be a very tiny "init kernel" written in C, which intrisically does some of the things that only it can (like reap processes parented to PID 1), and farms out everything else to a larger daemon. This would be for the sake of fault isolation; we don't want PID 1 to crash. The risk of that is high if you make it a large and complicated program, with a large and complicated run-time infrastructure.