]> git.proxmox.com Git - pve-cluster.git/blame - debian/pve-cluster.postinst
fix #2049: avoid conflict with chrony service
[pve-cluster.git] / debian / pve-cluster.postinst
CommitLineData
ec826d72
TL
1#!/bin/bash
2
3# abort if any command returns an error value
4set -e
5
6# handle problem with ha-manager <= 2.0-3 which cannot handle a pmxcfs
7# restart correctly
8# TODO: remove in PVE 6.0
9ha_version=$(dpkg-query --showformat='${Version}' --show pve-ha-manager)
10hacfg_version=$(dpkg-query --showformat='${Config-Version}' --show pve-ha-manager)
11
12function handlehaservice {
13 if test -z "$1"; then
14 # no old version, nothing to do
15 true
16 else
17 if dpkg --compare-versions "$ha_version" '<=' '2.0-3' || dpkg --compare-versions "$hacfg_version" '<=' '2.0-3'; then
ec826d72
TL
18 if systemctl --quiet "$2" "pve-ha-lrm.service"; then
19 systemctl "$3" "pve-ha-lrm.service"
20 fi
28c493ac
TL
21 if systemctl --quiet "$2" "pve-ha-crm.service"; then
22 systemctl "$3" "pve-ha-crm.service"
23 fi
ec826d72
TL
24 fi
25 fi
26}
27
28
29case "$1" in
30 configure)
31 handlehaservice "$2" 'is-active' 'stop'
32 ;;
33
34esac
35
36#DEBHELPER#
37
38case "$1" in
39 configure)
40 handlehaservice "$2" 'is-enabled' 'start'
41 ;;
42
43esac