Hi!

Could you have a look at my package please? Created a minimal package
[1] for demonstration of this issue. (Just git clone it and run ./build.)

On a Debian jessie system systemd unit gets installed to
/lib/systemd/system/hellodaemon.service, is functional, but does not get
enabled by default for some reason.

The postinst script [2] just looks normal, includes

> deb-systemd-helper enable hellodaemon.service >/dev/null || true

which I confirmed to be executed. Manually started using

> sudo systemctl start hellodaemon

is functional as well.

Manually running 'sudo systemctl enable hellodaemon' would work, though.
The symlink would then be created and the daemon started at boot.

I am just wondering why the service does not get enabled by default
after package installation. 'sudo systemctl is-enabled
hellodaemon.service' outputs 'disabled'.

(Some more debug output. [3])

Cheers,
Patrick

[1] https://github.com/adrelanos/hellodaemon

[2]

#!/bin/sh
set -e
# Automatically added by dh_systemd_enable
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask hellodaemon.service >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled hellodaemon.service; then
        # Enables the unit on first installation, creates new
        # symlinks on upgrades if the unit file has changed.
        deb-systemd-helper enable hellodaemon.service >/dev/null || true
else
        # Update the statefile to add new symlinks (if any), which need to be
        # cleaned up on purge. Also remove old symlinks.
        deb-systemd-helper update-state hellodaemon.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/hellodaemon" ]; then
        update-rc.d hellodaemon defaults >/dev/null
        invoke-rc.d hellodaemon start || exit $?
fi
# End automatically added section
# Automatically added by dh_systemd_start
if [ -d /run/systemd/system ]; then
        systemctl --system daemon-reload >/dev/null || true
        deb-systemd-invoke start hellodaemon.service >/dev/null || true
fi
# End automatically added section

[3] With a debian/hellodaemon.postinst with added debugging:

#!/bin/sh

set -x
set -e

export _DEB_SYSTEMD_HELPER_DEBUG=1

#DEBHELPER#

Output during installation:

+ set -e
+ export _DEB_SYSTEMD_HELPER_DEBUG=1
+ deb-systemd-helper unmask hellodaemon.service
(deb-systemd-helper DEBUG) is purge = no
(deb-systemd-helper DEBUG) action = unmask, scriptname =
hellodaemon.service, service_path = /lib/systemd/system/hellodaemon.service
(deb-systemd-helper DEBUG) rmdir_if_empty
/var/lib/systemd/deb-systemd-helper-masked
(deb-systemd-helper DEBUG)
rmdir(/var/lib/systemd/deb-systemd-helper-masked) failed (No such file
or directory)
+ deb-systemd-helper --quiet was-enabled hellodaemon.service
(deb-systemd-helper DEBUG) is purge = no
(deb-systemd-helper DEBUG) action = was-enabled, scriptname =
hellodaemon.service, service_path = /lib/systemd/system/hellodaemon.service
(deb-systemd-helper DEBUG) Reading state file
/var/lib/systemd/deb-systemd-helper-enabled/hellodaemon.service.dsh-also
(deb-systemd-helper DEBUG) Contents: $VAR1 = [];

(deb-systemd-helper DEBUG) All links present, considering
hellodaemon.service was-enabled.
+ deb-systemd-helper enable hellodaemon.service
(deb-systemd-helper DEBUG) is purge = no
(deb-systemd-helper DEBUG) action = enable, scriptname =
hellodaemon.service, service_path = /lib/systemd/system/hellodaemon.service
+ [ -x /etc/init.d/hellodaemon ]
+ [ -d /run/systemd/system ]
+ systemctl --system daemon-reload
+ deb-systemd-invoke start hellodaemon.service

_______________________________________________
Pkg-systemd-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-systemd-maintainers

Reply via email to