[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#455264: openais: add ais user



Package: openais
Version: 0.82-2
Severity: whishlist
Tags: patch

Hi,
this patch adds/removes the openais user - the default user aisexec
wants to run as if not started via e.g. cman. Please apply.
Cheers,
 -- Guido

diff --git a/debian/control b/debian/control
index 75abac2..10df458 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends: dpatch, debhelper (>> 5)
 Package: openais
 Section: admin
 Architecture: any
-Depends: ${shlibs:Depends}, libopenais2 (= ${binary:Version})
+Depends: ${shlibs:Depends}, libopenais2 (= ${binary:Version}), adduser
 Description: Standards-based cluster framework (daemon and modules)
  The openais project is a project to implement a production quality
  "Revised BSD" licensed implementation of the SA Forum's Application
diff --git a/debian/openais.postinst b/debian/openais.postinst
new file mode 100644
index 0000000..617b908
--- /dev/null
+++ b/debian/openais.postinst
@@ -0,0 +1,42 @@
+#!/bin/sh
+# postinst script for openais
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+	if ! getent passwd ais >/dev/null; then
+		adduser --group --system ais --home=/usr/lib/openais --no-create-home
+	fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/openais.postrm b/debian/openais.postrm
new file mode 100644
index 0000000..1eb2f13
--- /dev/null
+++ b/debian/openais.postrm
@@ -0,0 +1,40 @@
+#!/bin/sh
+# postrm script for openais
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge)
+	deluser --quiet --system ais
+    ;;
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0




Reply to: