summaryrefslogtreecommitdiff
path: root/mongod
blob: 9c87973326df185c9f95ce004dab07ca5713f813 (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
#!/sbin/openrc-run

command="/usr/bin/mongod"
command_args="--fork --config /etc/mongodb.conf "
pidfile="/var/run/mongodb/mongod.pid"
name="MongoDB"
description="MongoDB is a high-performance, open-source, NoSQL database"

depend() {
    need net
    after firewall
}

start_pre() {
    checkpath --directory --owner mongodb:mongodb --mode 0755 /var/run/mongodb
    checkpath --directory --owner mongodb:mongodb --mode 0755 /var/lib/mongodb
}

start() {
    ebegin "Starting ${name}"
    start-stop-daemon --start --quiet --exec ${command} -- ${command_args}
    eend $?
}

stop() {
    ebegin "Stopping ${name}"
    start-stop-daemon --stop --quiet --pidfile ${pidfile}
    eend $?
}