summaryrefslogtreecommitdiffstats
path: root/debian/pacemaker-common.postinst
blob: fa50c1278ee169c4834a9f2bcf6925d9d4429d9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

set -e

if [ "$1" = configure ]; then
    addgroup --system haclient
    adduser --system hacluster --ingroup haclient --home /var/lib/pacemaker --no-create-home
    # keep this list in sync with that in the postrm
    for dir in \
        750:/var/lib/pacemaker/pengine \
        750:/var/lib/pacemaker/cib \
        750:/var/lib/pacemaker/cores \
        750:/var/lib/pacemaker/blackbox \
        770:/var/log/pacemaker/bundles \
        770:/var/log/pacemaker \
        ; do
        if ! dpkg-statoverride --list "${dir#*:}" >/dev/null 2>&1; then
            dpkg-statoverride --update --add hacluster haclient "${dir%%:*}" "${dir#*:}"
        fi
    done
    AUTHKEY=/etc/pacemaker/authkey
    if ! [ -e "$AUTHKEY" ]; then
        ( umask 037 && dd if=/dev/urandom of="$AUTHKEY" bs=4096 count=1 )
        chgrp haclient "$AUTHKEY"
    fi
fi

#DEBHELPER#