[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, master, updated. debian/1.3.0-1-7-g46a112f

Stig Sandbeck Mathisen ssm at debian.org
Wed Jun 6 22:30:10 UTC 2012


The following commit has been merged in the master branch:
commit 5073de01bc495a25ff40f95cb67314461dc9562c
Author: Stig Sandbeck Mathisen <ssm at debian.org>
Date:   Wed Jun 6 22:28:46 2012 +0200

    Create nagios user in postinst (Closes: #676418)

diff --git a/debian/control b/debian/control
index a2f1cd6..ddfab65 100644
--- a/debian/control
+++ b/debian/control
@@ -42,7 +42,7 @@ Description: Nagios/Icinga event broker module for Mod-Gearman
 
 Package: mod-gearman-worker
 Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}, adduser
 Description: Worker agent for Mod-Gearman
  The worker agent for Mod-Gearman connects to a Gearman job server,
  runs active Icinga/Nagios service checks, and return the results.
diff --git a/debian/mod-gearman-worker.postinst b/debian/mod-gearman-worker.postinst
index c1fc8b9..73f6c26 100644
--- a/debian/mod-gearman-worker.postinst
+++ b/debian/mod-gearman-worker.postinst
@@ -2,4 +2,24 @@
 
 set -e
 
+create_user() {
+    if ! getent passwd nagios > /dev/null; then
+        adduser --quiet --system --group --disabled-login \
+            --home /var/lib/nagios nagios
+    fi
+}
+
+case "$1" in
+    configure)
+        create_user
+        ;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+        ;;
+
+    *)
+        echo "postinst called with unknown argument '$1'" >&2
+        exit 1
+        ;;
+esac
+
 #DEBHELPER#

-- 
Debian packaging for mod gearman.



More information about the Pkg-nagios-changes mailing list