Hi folks!
I just wanted to report on an experiment that I’ve conducted this week: moving away from our very simple task management system (StartTask
, StopTask
) towards systemd.
Compiling systemd was smooth – the recipe has already been pushed to Git. The one thing to pay attention to is that systemd comes with executables that will conflict with files from existing packages. Building it with Compile --symlink force systemd
ensures that files from systemd take precedence over the ones already in place.
The runtime issues I ran into had to do mostly with the configuration of our DBus package:
- DBus is looking for service files under
/System/Settings/dbus-1/system.d
only, whereas systemd installs them under/System/Index/share/dbus-1/system.d
. Compatibility symlinks have worked around the problem, but that needs proper fixing. - The DBus package needsto be recompiled with modified flags after systemd has been installed: options
--without-systemdsystemunitdir
and--disable-systemd
must be excluded from the recipe and replaced with--enable-systemd
.
Other notes:
- Make sure to create
/System/Settings/machine-id
by runningsystemd-machine-id-setup
. That should be part of as aPostInstall
script, but I haven’t taken the time to write and test that. - We have a bug on
/etc/passwd
! The user id forpolkitd
is missing. Please search forpolkitd
and replacepolkitd:x::31
withpolkitd:x:31:31
- Unit files do not inherit our customized
PYTHONPATH
. If a task depends on modules installed under/System/Aliens
, then make sure to add something along the lines ofEnvironmentFile=/path/to/file
under the[Service]
section of the relevant unit file. - It helps to edit the GRUB command line and append
systemd.debug-shell=1
to the boot parameters so that tty9 can be used as a recovery shell in case something goes wrong. Another useful parameter issystemd.unit=recovery.target
.
Note that scripts such as DisableProgram
and RemoveProgram
would have to be eventually made aware of systemd so that services can be properly stopped/disabled. There may be some other hooks that may need updating, but overall the conversion has been surprisingly easy.
Cheers
Lucas