]> git.proxmox.com Git - lxcfs.git/blame - debian/lxcfs.postinst
d/triggers: drop useless activation of ldconfig trigger
[lxcfs.git] / debian / lxcfs.postinst
CommitLineData
1c9d15dc
FG
1#!/bin/sh
2
3set -e
4
5case "$1" in
6 configure)
117e738a
TL
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
e128697a 15 systemctl --system daemon-reload >/dev/null || true
117e738a 16 deb-systemd-invoke $dh_action "$unit"
1c9d15dc
FG
17 fi
18 ;;
19
20esac
21
bff451d2
WB
22# Copied from dh_installsystemd/12.1.1
23if [ "$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
37fi
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!
1c9d15dc
FG
41
42exit 0