From 117e738a2f0e11cc259ff869c670ef5048d97788 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 22 May 2019 11:56:23 +0200 Subject: [PATCH] d/postinst: use deb-systemd-invoke for resart instead of sendingg manually a USR1 to the lxcfs pid pulled from it's /run pid file Signed-off-by: Thomas Lamprecht --- debian/lxcfs.postinst | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/debian/lxcfs.postinst b/debian/lxcfs.postinst index 42dd1ec..da23c87 100644 --- a/debian/lxcfs.postinst +++ b/debian/lxcfs.postinst @@ -4,12 +4,15 @@ set -e case "$1" in configure) - # Check for reload support in lxcfs - if [ -n "$2" ] && dpkg --compare-versions "$2" ge 2.0.0-pve1; then - # Check for running lxfs - if [ -f /run/lxcfs.pid ]; then - kill -USR1 `cat /run/lxcfs.pid` - fi + if test -n "$2"; then # upgrade + dh_action="reload-or-try-restart"; + else + dh_action="start" + fi + + unit=lxcfs.service + if systemctl -q is-enabled "$unit"; then + deb-systemd-invoke $dh_action "$unit" fi ;; -- 2.39.5