]> git.proxmox.com Git - lxcfs.git/blob - debian/lxcfs.postinst
d/rules: drop superfluos --with=quilt
[lxcfs.git] / debian / lxcfs.postinst
1 #!/bin/sh
2
3 set -e
4
5 case "$1" in
6 configure)
7 if test -n "$2"; then # upgrade
8 dh_action="reload-or-try-restart";
9 else
10 dh_action="start"
11 fi
12
13 unit=lxcfs.service
14 if systemctl -q is-enabled "$unit"; then
15 systemctl --system daemon-reload >/dev/null || true
16 deb-systemd-invoke $dh_action "$unit"
17 fi
18 ;;
19
20 esac
21
22 # Copied from dh_installsystemd/12.1.1
23 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
24 # This will only remove masks created by d-s-h on package removal.
25 deb-systemd-helper unmask 'lxcfs.service' >/dev/null || true
26
27 # was-enabled defaults to true, so new installations run enable.
28 if deb-systemd-helper --quiet was-enabled 'lxcfs.service'; then
29 # Enables the unit on first installation, creates new
30 # symlinks on upgrades if the unit file has changed.
31 deb-systemd-helper enable 'lxcfs.service' >/dev/null || true
32 else
33 # Update the statefile to add new symlinks (if any), which need to be
34 # cleaned up on purge. Also remove old symlinks.
35 deb-systemd-helper update-state 'lxcfs.service' >/dev/null || true
36 fi
37 fi
38
39 # dh_installsystemd cannot do a reload, you can only choose between stop-start,
40 # restart and try-restart. NONE of which are acceptable!
41
42 exit 0