summaryrefslogtreecommitdiff
path: root/community-testing/mongodb/mongodb.install
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-03-05 00:01:22 +0000
committerroot <root@rshg054.dnsready.net>2012-03-05 00:01:22 +0000
commit11711de1942a141f28faef695c4c78c8357fbf23 (patch)
tree363a8b5d445b8eb1dcee4263b5f06d2fe307678f /community-testing/mongodb/mongodb.install
parentf0fa42126da9e3eec6b98388b35c67929fa20dae (diff)
Mon Mar 5 00:01:22 UTC 2012
Diffstat (limited to 'community-testing/mongodb/mongodb.install')
-rw-r--r--community-testing/mongodb/mongodb.install32
1 files changed, 32 insertions, 0 deletions
diff --git a/community-testing/mongodb/mongodb.install b/community-testing/mongodb/mongodb.install
new file mode 100644
index 000000000..3922c12ef
--- /dev/null
+++ b/community-testing/mongodb/mongodb.install
@@ -0,0 +1,32 @@
+# vim: syntax=sh
+
+post_install() {
+ useradd -r -g daemon -d /var/lib/mongodb -s /bin/bash mongodb
+ chown -R mongodb:daemon /var/lib/mongodb
+ chown -R mongodb:daemon /var/log/mongodb
+
+ if [ "$(arch)" != "x86_64" ]
+ then
+ echo '==> Warning: the 32 bit version of MongoDB is limited to about 2GB of data.'
+ echo '==> See http://blog.mongodb.org/post/137788967/32-bit-limitations'
+ fi
+}
+
+post_upgrade() {
+ chown -R mongodb:daemon /var/lib/mongodb
+ chown -R mongodb:daemon /var/log/mongodb
+
+ if [ "$(vercmp $2 1.8.2-3)" -lt 0 ]
+ then
+ # have to fix my fudge up in 1.8.2-2 and 1.8.2-3
+ # added july 5th, 2011
+ usermod -s /bin/bash mongodb >& /dev/null
+ echo 'The dbpath has changed from /var/state/mongodb to /var/lib/mongodb'
+ echo 'Make sure you move your data files to the new dbpath before you start/restart mongodb'
+ echo 'The logpath has changed from /var/log/mongod to /var/log/mongodb/mongod.log'
+ fi
+}
+
+pre_remove() {
+ userdel mongodb
+}