This blog post is the second of a series of posts dealing with the results of the Debian systemd survey. I intend to give a presentation at DebConf 2013, too, so you could either read my posts, or watch the talk, or both :-).
It seems that it is unclear how Debian’s transition to systemd is intended to
work. By “transition”, we mean going from the current state (sysvinit is the
default and fully supported) to systemd is fully supported. Then by
merely installing systemd by default and letting it provide
/sbin/init
, we can make it the default init system. If and when
that happens is a different matter and it’s not necessary for all packages to
have systemd support.
systemd natively supports sysvinit scripts, meaning your existing package will work as-is — but you cannot utilize all the features that systemd provides. The sysvinit support works very well, as you can try in a fresh Debian wheezy VM. In the output of “systemctl list-units”, every entry which has an “LSB: ” prefix is actually a sysvinit script.
The mechanism with which systemd decides whether to use an init script or a
service file is by looking whether a service file with a corresponding name
exists. That is, if e.g. apache2.service
exists, systemd will
prefer it over /etc/init.d/apache2
.
To make this crystal clear: it is not necessary to ship service files for all services in some kind of flag day. systemd supports a “mixed” installation where some services use init scripts and some services use service files.
In a nutshell, it usually works like this:
/lib/systemd/system/foo.service
..service
file.debian/package.service
apache2.service
for /etc/init.d/apache2
)
--with=systemd
in debian/rules
and Build-Dep on dh-systemd
For details see wiki.debian.org/Systemd/Packaging.
We carefully made sure that you can install the systemd Debian package on your
machine alongside sysvinit without breaking anything. The systemd package does
not conflict with any other packages, it will not replace
/sbin/init
and systemd will not be enabled right away. It is only
after you specify the kernel parameter init=/bin/systemd
in
/etc/default/grub
that you switch to systemd. In case you want to
go back, simply boot without this kernel parameter.
In conclusion, the transition is straight-forward and the necessary infrastructure is in place. systemd is available in Debian and can be used today. Packages can add systemd support whenever their maintainer(s) feel like it. There is no need for a flag day. We can switch the default whenever we think we are ready.