]> git.proxmox.com Git - proxmox-backup.git/commitdiff
try to reload proxmox-backup-proxy on package upgrade
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 22 Jun 2020 07:39:37 +0000 (09:39 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 22 Jun 2020 07:39:37 +0000 (09:39 +0200)
debian/postinst [new file with mode: 0644]
debian/prerm [new file with mode: 0644]
debian/rules
etc/proxmox-backup-proxy.service.in

diff --git a/debian/postinst b/debian/postinst
new file mode 100644 (file)
index 0000000..ee31737
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+case "$1" in
+    configure)
+       # modeled after dh_systemd_start output
+       systemctl --system daemon-reload >/dev/null || true
+       if [ -n "$2" ]; then
+               _dh_action=try-restart
+       else
+               _dh_action=start
+       fi
+       deb-systemd-invoke $_dh_action proxmox-backup.service >/dev/null || true
+
+       if [ -n "$2" ]; then
+               _dh_action=try-reload-or-restart
+       else
+               _dh_action=start
+       fi
+       deb-systemd-invoke $_dh_action proxmox-backup-proxy.service >/dev/null || true
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+exit 0
diff --git a/debian/prerm b/debian/prerm
new file mode 100644 (file)
index 0000000..77f9eaf
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+# modeled after dh_systemd_start output
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+    deb-systemd-invoke stop 'proxmox-backup-banner.service' 'proxmox-backup-proxy.service' 'proxmox-backup.service' >/dev/null || true
+fi
index 7d0067dbc74c3ee621d815f10a2186240da1e436..6f4dc80f848e9e020b7e43ea70d856cea815abe2 100755 (executable)
@@ -37,9 +37,9 @@ override_dh_auto_install:
            PROXY_USER=backup \
            LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
 
-override_dh_installinit:
-       dh_installinit
-       dh_installinit --name proxmox-backup-proxy
+override_dh_installsystemd:
+       # note: we start/try-reload-restart services manually in postinst
+       dh_installsystemd --no-start --no-restart-after-upgrade
 
 # workaround https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933541
 # TODO: remove once available (Debian 11 ?)
index d233f7b92d9822c64f5e2c92f4acd9669067d9a0..e389a5650b9a1a3ab959d932c55ccd6594aff629 100644 (file)
@@ -2,7 +2,7 @@
 Description=Proxmox Backup API Proxy Server
 Wants=network-online.target
 After=network.target
-Requires=proxmox-backup.service
+Wants=proxmox-backup.service
 After=proxmox-backup.service
 
 [Service]