Created
February 17, 2015 01:55
-
-
Save VatslavDS/49066bf821a92b8c76f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# mongodb Startup script for the mongodb server | |
# | |
# chkconfig: - 64 36 | |
# description: MongoDB Database Server | |
# | |
# processname: mongodb | |
# | |
# Source function library | |
. /etc/rc.d/init.d/functions | |
if [ -f /etc/sysconfig/mongodb ]; then | |
. /etc/sysconfig/mongodb | |
fi | |
prog="mongod" | |
mongod="/srv/mongodb/bin/mongod" | |
RETVAL=0 | |
start() { | |
echo -n $"Starting $prog: " | |
daemon $mongod "--fork --logpath /data/db/log/mongodb/actinver_services.log --logappend 2>&1 >>/data/db/log/mongodb/actinver_services.log" | |
RETVAL=$? | |
echo | |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog | |
return $RETVAL | |
} | |
stop() { | |
echo -n $"Stopping $prog: " | |
killproc $prog | |
RETVAL=$? | |
echo | |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog | |
return $RETVAL | |
} | |
reload() { | |
echo -n $"Reloading $prog: " | |
killproc $prog -HUP | |
RETVAL=$? | |
echo | |
return $RETVAL | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
condrestart) | |
if [ -f /var/lock/subsys/$prog ]; then | |
stop | |
start | |
fi | |
;; | |
reload) | |
reload | |
;; | |
status) | |
status $mongod | |
RETVAL=$? | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}" | |
RETVAL=1 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment