This draft describes how systemd packaging should be done in Debian. It will be integrated into ?Systemd once it has been reviewed.
systemd packaging
per-package
- Unit file location:
- In case there is any reason for the system administrator to customize the unit file (adding parameters to the daemon startup, changing cgroup limits, etc.), the file should be placed in /etc/systemd/system (being in /etc, it will automatically be treated as a conffile).
- In case there is no reason at all to customize it, the file should be shipped in /lib/systemd/system instead (examples are debian-fixup.service, udev.service or munin-node.service).
The systemctl enable and systemctl start actions are performed through update-rc.d and invoke-rc.d (NOTE: These don’t previde the necessary code yet!)
globally
Calling systemctl enable on Debian will also run update-rc.d enable and vice-versa so that you can switch to and from systemd without losing this configuration.
- invoke-rc.d will automatically proxy its actions to systemd on systems running systemd
Custom actions are still passed to the initscript directly, for example the _cron action of /etc/init.d/atop. The actions which are passed to systemd are start, stop, restart, status, reload, force-stop and force-reload.
TODO: Do we want to recommend not using custom actions in initscripts?
To determine whether systemd is currently running on a system, use [ -d /sys/fs/cgroup/systemd ]
unit files
Please don’t use After=syslog.target. It’s obsolete since syslog services are socket-activated nowadays.
email (draft) to pkg-sysvinit-devel
Subject: [RFC] Patches to make update-rc.d/invoke-rc.d systemd-aware Hello, we (systemd Debian maintainers) are currently working on creating a policy for how Debian packages should deal with systemd. One of our goals is to maintain compatibility with sysvinit as good as possible so that users can switch to and from systemd as they wish. To be precise, this means that invoke-rc.d and update-rc.d should be made systemd-aware, so that the changes to existing packages will be as small as possible. I have attached patches for invoke-rc.d and update-rc.d which make them systemd-aware. What are your thoughts on that? Best regards, Michael (for the Debian systemd maintainers)