summaryrefslogtreecommitdiff
path: root/debian/mongodb-org-unstable-server.postinst
diff options
context:
space:
mode:
authorErnie Hershey <ernie.hershey@10gen.com>2013-09-13 12:54:31 -0400
committerErnie Hershey <ernie.hershey@10gen.com>2013-09-25 21:41:28 -0400
commit787d2d85a8693dce18137866e5ac969e5f97e66a (patch)
tree2fff953fc55d4beb7347fd10828cf71351957230 /debian/mongodb-org-unstable-server.postinst
parentcd2f9548a39b1fd215e983610ddb2edd0d694abf (diff)
downloadmongo-787d2d85a8693dce18137866e5ac969e5f97e66a.tar.gz
SERVER-3579 replace mongo-10gen and mongodb-10gen with mongodb-org
Diffstat (limited to 'debian/mongodb-org-unstable-server.postinst')
-rw-r--r--debian/mongodb-org-unstable-server.postinst55
1 files changed, 55 insertions, 0 deletions
diff --git a/debian/mongodb-org-unstable-server.postinst b/debian/mongodb-org-unstable-server.postinst
new file mode 100644
index 00000000000..4d0e786ef87
--- /dev/null
+++ b/debian/mongodb-org-unstable-server.postinst
@@ -0,0 +1,55 @@
+#!/bin/sh
+# postinst script for mongodb
+#
+# 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)
+ # create a mongodb group and user
+ if ! grep -q mongodb /etc/passwd; then
+ adduser --system --no-create-home mongodb
+ addgroup --system mongodb
+ adduser mongodb mongodb
+ fi
+
+ # create db -- note: this should agree with dbpath in mongodb.conf
+ mkdir -p /var/lib/mongodb
+ chown -R mongodb:mongodb /var/lib/mongodb
+
+ # create logdir -- note: this should agree with logpath in mongodb.conf
+ mkdir -p /var/log/mongodb
+ chown -R mongodb:mongodb /var/log/mongodb
+ ;;
+
+ 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
+
+