Sha256: 73d93adaec8573b8f5f8fdfe3614fa78a15be7bc2e25c120e2f91504a8b59c21

Contents?: true

Size: 1.28 KB

Versions: 87

Compression:

Stored size: 1.28 KB

Contents

#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
MONGOD=/usr/local/mongo/bin/mongod
DATADIR=/var/lib/mongodb
PIDFILE=$DATADIR/mongod.lock
LOGFILE=/var/log/mongodb.log
EXTRAOPTS=
ENABLED=1

test -x $MONGOD || exit 0

if [ -e /etc/default/mongodb ]; then
	. /etc/default/mongodb
fi

test "$ENABLED" != "0" || exit 0

[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions


mongodb_start()
{
	start-stop-daemon --start --pidfile "$PIDFILE" \
		--exec $MONGOD -- --fork --logpath $LOGFILE --logappend --dbpath $DATADIR \
		$EXTRAOPTS || return 2
	return 0
}

mongodb_stop()
{
	start-stop-daemon --stop --user root --pidfile "$PIDFILE" \
		|| return 2
	return 0
}

case "$1" in
start)
	log_daemon_msg "Starting mongodb" "mongodb"
	mongodb_start
	case "$?" in
	0)
		log_end_msg 0
		;;
	1)
		log_end_msg 1
		echo "pid file '$PIDFILE' found, mongodb not started."
		;;
	2)
		log_end_msg 1
		;;
	esac
	;;
stop)
	log_daemon_msg "Stopping mongodb" "mongodb"
	mongodb_stop
	case "$?" in
	0|1)
		log_end_msg 0
		;;
	2)
		log_end_msg 1
		;;
	esac
	;;
restart)
	log_daemon_msg "Restarting mongodb" "mongodb"
	mongodb_stop
	mongodb_start
	case "$?" in
	0)
		log_end_msg 0
		;;
	1)
		log_end_msg 1
		;;
	2)
		log_end_msg 1
		;;
	esac
	;;
*)
	echo "Usage: /etc/init.d/mongodb {start|stop|restart}"
	exit 3
	;;
esac

:

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
le1t0-deprec-2.1.6.047 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.046 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.045 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.044 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.043 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.042 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.041 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.040 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.039 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.038 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.037 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.036 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.035 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.034 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.033 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.032 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.031 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.030 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.029 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.028 lib/deprec/templates/mongodb/mongodb-init.d