[Pkg-systemd-maintainers] Bug#713982: Use dh-systemd for proper systemd-related maintscripts

Michael Biebl biebl at debian.org
Mon Jun 24 16:02:55 BST 2013


Package: syslog-ng
Version: 3.3.9-1
Severity: normal
Tags: patch
User: pkg-systemd-maintainers at lists.alioth.debian.org
Usertags: systemd-units

Hi,

the current version of syslog-ng ships systemd service files.
Those systemd services need to be enabled explicitly, using "systemctl
enable". As packages can't rely on systemd being installed, what
syslog-ng currently does is ship a *copy* of those files in
multi-user.target.wants (as a conffile). That is not how it's supposed
to work (we partially fixed that for the wheezy version by turning those
conffiles into symlinks, but this was an imcomplete fix, too).

We now have a small helper  in init-system-helper which implements the
"systemctl enable" parts in a minimal package and a corresponding
dh-systemd helper, which generates the corresponding maintainer scripts
code.

The attached patch uses that helper (via the dh addon) and cleans up the
exising conffiles in preinst.

The new mechanism will ensure that changes will be preserved.
I.e., if an administrator disables the systemd service via "systemctl
disable syslog-ng.service", it won't be re-enabled on the next upgrade.

We've put up some preliminary documentation up on [1]. Please have a
look there if you want to know more. We are also very much interested in
feedback, so we can improve the documentation.


The attached patch also adds /var/lib/syslog-ng to syslog-ng-core.dirs.
While testing the patch, I only had syslog-ng-core installed, and
starting the service failed as that directory was missing.
I noticed, that the SysV init script creates that directory dynamically.
I didn't see a good reason, not to ship that directory in the package
itself, so I decided to do just that.
If you prefer to create the directory dynamically, the preferred
mechanism is, to ship a tmpfile. Please let me know in this case and I
will update the patch accordingly.


Cheers,
Michael



[1] https://wiki.debian.org/Systemd/Packaging

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.9-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
-------------- next part --------------
A non-text attachment was scrubbed...
Name: syslog-ng-systemd-support.patch
Type: text/x-diff
Size: 3344 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20130624/0ae32727/attachment-0001.patch>


More information about the Pkg-systemd-maintainers mailing list