try to reload proxmox-backup-proxy on package upgrade

This commit is contained in:
Dietmar Maurer 2020-06-22 09:39:37 +02:00
parent f28cfb322a
commit b28253d650
4 changed files with 49 additions and 4 deletions

35
debian/postinst vendored Normal file
View File

@ -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

10
debian/prerm vendored Normal file
View File

@ -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

6
debian/rules vendored
View File

@ -37,9 +37,9 @@ override_dh_auto_install:
PROXY_USER=backup \ PROXY_USER=backup \
LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
override_dh_installinit: override_dh_installsystemd:
dh_installinit # note: we start/try-reload-restart services manually in postinst
dh_installinit --name proxmox-backup-proxy dh_installsystemd --no-start --no-restart-after-upgrade
# workaround https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933541 # workaround https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933541
# TODO: remove once available (Debian 11 ?) # TODO: remove once available (Debian 11 ?)

View File

@ -2,7 +2,7 @@
Description=Proxmox Backup API Proxy Server Description=Proxmox Backup API Proxy Server
Wants=network-online.target Wants=network-online.target
After=network.target After=network.target
Requires=proxmox-backup.service Wants=proxmox-backup.service
After=proxmox-backup.service After=proxmox-backup.service
[Service] [Service]