]> git.proxmox.com Git - proxmox-backup.git/blame - debian/postinst
d/postinst: drop some legacy update handling
[proxmox-backup.git] / debian / postinst
CommitLineData
b28253d6
DM
1#!/bin/sh
2
3set -e
4
5#DEBHELPER#
6
7case "$1" in
8 configure)
227f3649 9 # need to have user backup in the tape group
a57ce270
DM
10 usermod -a -G tape backup
11
b28253d6
DM
12 # modeled after dh_systemd_start output
13 systemctl --system daemon-reload >/dev/null || true
b28253d6 14 if [ -n "$2" ]; then
e056966b
TL
15 if dpkg --compare-versions "$2" 'lt' '1.0.7-1'; then
16 # there was an issue with reloading and systemd being confused in older daemon versions
17 # so restart instead of reload if upgrading from there, see commit 0ec79339f7aebf9
18 # FIXME: remove with PBS 2.1
2a29d9a1 19 echo "Upgrading from older proxmox-backup-server: restart (not reload) daemons"
e056966b
TL
20 _dh_action=try-restart
21 else
22 _dh_action=try-reload-or-restart
23 fi
b28253d6
DM
24 else
25 _dh_action=start
26 fi
d7992679 27 deb-systemd-invoke $_dh_action proxmox-backup.service proxmox-backup-proxy.service >/dev/null || true
aafe8609 28
83b039af 29 if test -n "$2"; then
8f7e5b02
TL
30 # FIXME: Remove in future version once we're sure no broken entries remain in anyone's files
31 if grep -q -e ':termproxy::[^@]\+: ' /var/log/proxmox-backup/tasks/active; then
32 echo "Fixing up termproxy user id in task log..."
33 flock -w 30 /var/log/proxmox-backup/tasks/active.lock sed -i 's/:termproxy::\([^@]\+\): /:termproxy::\1@pam: /' /var/log/proxmox-backup/tasks/active || true
34 fi
aafe8609 35 fi
b28253d6
DM
36 ;;
37
38 abort-upgrade|abort-remove|abort-deconfigure)
39 ;;
40
41 *)
42 echo "postinst called with unknown argument \`$1'" >&2
43 exit 1
44 ;;
45esac
46
47exit 0