[Pkg-nagios-changes] [SCM] Packaging of check_mk branch, master, updated. 60c0abe8da5653f47782a2125347651282f5654f
Alexander Wirt
formorer at debian.org
Sat Mar 5 09:20:36 UTC 2011
The following commit has been merged in the master branch:
commit 9ba4c6e8bf76c008e2ab792c143803bee11b074d
Author: Alexander Wirt <formorer at debian.org>
Date: Sat Mar 5 10:13:03 2011 +0100
Add new postinst for server component
diff --git a/debian/check-mk-server.postinst b/debian/check-mk-server.postinst
new file mode 100644
index 0000000..c79017d
--- /dev/null
+++ b/debian/check-mk-server.postinst
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+set -e
+
+# a little helper for getting permissions right
+setperm() {
+ local user="$1"
+ local group="$2"
+ local mode="$3"
+ local file="$4"
+ shift 4
+ # only do something when no setting exists
+ if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
+ chown "$user":"$group" "$file"
+ chmod "$mode" "$file"
+ fi
+}
+
+case "$1" in
+ configure)
+ #make sure our nagios user exists
+ if ! getent passwd nagios > /dev/null ; then
+ echo 'Adding system-user for nagios' 1>&2
+ adduser --system --group --home /var/lib/nagios \
+ --disabled-login --force-badname nagios > /dev/null
+ fi
+ #fix permissions for some directorys
+ test -d /var/lib/check_mk/cache || mkdir -p /var/lib/check_mk/cache
+ setperm nagios nagios 0750 /var/lib/check_mk/cache
+ ;;
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+ *)
+ echo "postinst called with unknown argument \$1'" >&2
+ exit 1
+ ;;
+esac
+
--
Packaging of check_mk
More information about the Pkg-nagios-changes
mailing list