summaryrefslogtreecommitdiff
path: root/community/mongodb/mongodb.install
blob: 9e13a4d14321a8db0951c9fb3032007449112e4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# vim: syntax=sh

show_msg(){
    if [ "$(arch)" != "x86_64" ]
    then
        cat <<END
==> Warning: the 32 bit version of MongoDB is limited to about 2GB of data.
==> See http://blog.mongodb.org/post/137788967/32-bit-limitations
END
    fi
}

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

  show_msg
}

post_upgrade() {
  chown -R mongodb:daemon /var/lib/mongodb
  chown -R mongodb:daemon /var/log/mongodb
}

pre_remove() {
  userdel mongodb
}