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.088 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.087 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.086 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.085 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.084 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.083 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.082 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.081 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.080 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.079 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.078 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.077 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.076 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.075 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.074 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.073 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.072 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.071 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.070 lib/deprec/templates/mongodb/mongodb-init.d
le1t0-deprec-2.1.6.069 lib/deprec/templates/mongodb/mongodb-init.d