summaryrefslogtreecommitdiffstats
path: root/debian/pacemaker-common.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/pacemaker-common.postinst')
-rw-r--r--debian/pacemaker-common.postinst28
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/pacemaker-common.postinst b/debian/pacemaker-common.postinst
new file mode 100644
index 0000000..fa50c12
--- /dev/null
+++ b/debian/pacemaker-common.postinst
@@ -0,0 +1,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#