summaryrefslogtreecommitdiff
path: root/community-staging/mongodb/mongodb.rc
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-11-25 12:00:05 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-11-25 12:00:05 -0300
commitd59c722c306fa39fcecf011b411b77faffca5cbd (patch)
treed6a3582523245b624d1a905d4b46d8344429e617 /community-staging/mongodb/mongodb.rc
parent939541abc901bd03328b55aaed0fb1862f803c05 (diff)
parent5894dd675f4bd3ba296d262fae99b3b87a0f87fd (diff)
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts: community/gri/PKGBUILD community/multiget/PKGBUILD core/bash/PKGBUILD core/grep/PKGBUILD extra/ffmpeg/PKGBUILD extra/vlc/PKGBUILD extra/xfce4-screenshooter/PKGBUILD extra/xfce4-settings/PKGBUILD libre/linux-libre/PKGBUILD libre/linux-libre/dib0700-fix.patch libre/linux-libre/i915-fix-ghost-tv-output.patch libre/linux-libre/i915-fix-incorrect-error-message.patch libre/linux-libre/iwlagn-fix-NULL-pointer-dereference.patch libre/linux-libre/linux-libre.install libre/linux-libre/usb-add-reset-resume-quirk-for-several-webcams.patch
Diffstat (limited to 'community-staging/mongodb/mongodb.rc')
-rwxr-xr-xcommunity-staging/mongodb/mongodb.rc39
1 files changed, 39 insertions, 0 deletions
diff --git a/community-staging/mongodb/mongodb.rc b/community-staging/mongodb/mongodb.rc
new file mode 100755
index 000000000..30f2bbf79
--- /dev/null
+++ b/community-staging/mongodb/mongodb.rc
@@ -0,0 +1,39 @@
+#!/bin/bash
+# vim: syntax=sh
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof /usr/bin/mongod)
+case "$1" in
+ start)
+ stat_busy "Starting mongodb"
+ [ -z "$PID" ] && /bin/su mongodb -c "/usr/bin/mongod --config /etc/mongodb.conf --fork" > /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon mongodb
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping mongodb"
+ [ ! -z "$PID" ] && /bin/su mongodb -c "/usr/bin/mongod --config /etc/mongodb.conf --shutdown" &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon mongodb
+ while [ ! -z "$(pidof /usr/bin/mongod)" ]; do
+ sleep 1;
+ done
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0