]> git.proxmox.com Git - lxcfs.git/blobdiff - debian/lxcfs.postinst
bump version to 5.0.3-pve2
[lxcfs.git] / debian / lxcfs.postinst
index 42dd1eca7def1fc01dd29d3872332cb97cef78df..344e5f2ae6b695fc7a9670a5dd24f87ae297fa65 100644 (file)
@@ -4,12 +4,16 @@ 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
+        systemctl --system daemon-reload >/dev/null || true
+        deb-systemd-invoke $dh_action "$unit"
     fi
   ;;