]> git.proxmox.com Git - lxcfs.git/commitdiff
d/postinst: use deb-systemd-invoke for resart
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 May 2019 09:56:23 +0000 (11:56 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 May 2019 09:56:27 +0000 (11:56 +0200)
instead of sendingg manually a USR1 to the lxcfs pid pulled from it's
/run pid file

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/lxcfs.postinst

index 42dd1eca7def1fc01dd29d3872332cb97cef78df..da23c8732145920e25463e3f04b9c4738cdf4a20 100644 (file)
@@ -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
   ;;