no crash handler required

uselessd-5 introduces early experimental support for running a global system instance, without requiring it to be PID1/init(8). test To build uselessd without init support, pass the --disable-initd flag to the configure script. This will set the condition ENABLE_INIT to false and compile a slimmed down version of main.c titled main-no-init.c, which cuts the uselessd binary down to a more general program for bringing up the Manager object. In addition, the /run/systemd/private IPC socket which systemctl uses to communicate over the bus is now created in all cases, regardless of the process PID. main-no-init also populates the minimal /run/systemd directory tree, otherwise accomplished by mount_setup().

What we didn't do is set up the cgroupfs and unified hierarchy, as Linux distributions differ on how they've already bootstrapped it. Debian and Ubuntu, pre-systemd versions included, should have it set up, and as such uselessd without init will work out of the box. In general, the procedure should resemble something like this:

mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup
mkdir -p /sys/fs/cgroup/systemd
mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd

You may also want to look at the systemd File Hierarchy Requirements, the uselessd README and the src/core/mount-setup.c file for hints on setting up the runtime environment. You might also want to check out the systemd package on Launchpad for an example of integration work on systemd.

From relatively brief testing, we found that status information, drop-in configuration, autorestart and the basic unit/unit file commands for systemctl all function properly. Current drawbacks may include diminished capacity for uselessd/systemd to handle forking daemons with the PIDFile= option set, and naturally, child processes that lose their parents (orphans) will not be reparented to us. You will need to rely on your actual init for that. Monitoring of uselessd itself will also need to be done by another process. System commands (halt, poweroff, reboot) do not work, nor do we really intend on making them. These belong to stage 3 (shutdown stage) and should be handled by your actual init. We will consider removing them entirely.

A consequence of all this is that targets ultimately lose all their special meaning (even if they were arbitrarily defined in the first place) and are now relegated purely to synchronization and service grouping points.

systemd-initctl and other libexec binaries that are intended to be invoked only by init will not function, either, but this will be alleviated later on.

/proc/cmdline parsing, crash shells, crash VTs, watchdog timers, switch-root handling, daemon-reexec/keexec/shutdown/reboot/halt/poweroff, system generator directories are no longer handled, neither is core dumped by default.

SIGINT and SIGTERM are interpreted as a MANAGER_EXIT, which was traditionally reserved for user instances of systemd. Bringing down the no-init daemon does not yet bring down services, this will be looked into later.

We will be sorting out the warts and making the environment setup more automatic in future releases. Please send us any bug reports and proposals to our issue tracker.