Migrating Debian and Ubuntu packages to systemd
Exceptions in rules Files
It does occasionally happen that debian/rules
includes other contents in addition to the call to dh
. At best, separate entries just supplement the work of dh
and override individual parts (targets). At worst, administrators will have to deal with a completely self-written rules
file. It is important to keep a cool head if this happens: rules
files normally use the debhelper suite.
Debhelper provides an approach for the package maintainer to change the normal sequence of steps for virtually any target. It is important to consider whether a target with the name override_dh_installinit
exists. If so, the rules
script is doing its own thing at this point. Unfortunately, it isn't possible to make a general statement about adapting to systemd. In such situations, the important thing in the end is that the script calls the dh_installinit
, dh_systemd_enable
, and dh_systemd_start
commands within the override_dh_installinit
target. If this happens, the debhelper scripts for systemd are aboard.
If dh is Missing Completely
Sometimes the rules
file does not call dh
at all, which is often the case for scripts that have some years under their belt and have long been abandoned. Anyone dealing with such a package would be best off making sure that the three debhelper commands in debian/rules
exist within the binary-arch
and the binary-indep
target. In most cases, this precaution is sufficient to ensure the systemd integration works correctly.
Infos
- systemd: https://wiki.freedesktop.org/www/Software/systemd/
- Debian: https://www.debian.org
- Mark Shuttleworth, "Losing graciously": http://www.markshuttleworth.com/archives/1316
- List of Ubuntu packages still to be converted: http://people.canonical.com/~jhunt/systemd/packages-to-convert/
- Comparison of Upstart and systemd unit files: https://wiki.ubuntu.com/SystemdForUpstartUsers
« Previous 1 2
Buy this article as PDF
(incl. VAT)