summaryrefslogtreecommitdiff
path: root/community/mongodb/mongodb.install
blob: 152f36515aa4f02d099ca88ea1dfc516d512bf90 (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
29
30
31
# 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/state/mongodb -s /bin/false mongodb
  chown -R mongodb:daemon /var/state/mongodb

  show_msg
}

post_upgrade() {
  chown -R mongodb:daemon /var/state/mongodb

  show_msg
}

pre_remove() {
    /etc/rc.d/mongodb stop
    userdel mongodb
}