Sha256: 69e80255521524bd6ac10a185127aa01d4112e0340874fb0f1c94c65a212a994

Contents?: true

Size: 1.34 KB

Versions: 37

Compression:

Stored size: 1.34 KB

Contents

#!/bin/bash

# <%= mongodb_name %> - Startup script for mongod

# chkconfig: 35 85 15
# description: Mongo is a scalable, document-oriented database.
# processname: <%= mongodb_name %>
# config: /etc/<%= mongodb_name %>.conf
# pidfile: /var/run/mongo/<%= mongodb_name %>.pid

. /etc/rc.d/init.d/functions

# things from <%= mongodb_name %>.conf get there by mongod reading it

OPTIONS=" -f /etc/<%= mongodb_name %>.conf"
SYSCONFIG="/etc/sysconfig/mongod"

mongod=${MONGOD-/usr/bin/mongod}

MONGO_USER=mongod
MONGO_GROUP=mongod

. "$SYSCONFIG" || true

start()
{
  echo -n $"Starting mongod: "
  daemon --user "$MONGO_USER" $mongod $OPTIONS
  RETVAL=$?
  echo
  [ $RETVAL -eq 0 ] && touch /var/lock/subsys/<%= mongodb_name %>
}

stop()
{
  echo -n $"Stopping mongod: "
  killproc -p <%= mongodb_data_path %>/mongod.lock -t30 -TERM /usr/bin/mongod
  RETVAL=$?
  echo
  [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/<%= mongodb_name %>
}

restart () {
        stop
        start
}

ulimit -n 12000
RETVAL=0

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart|reload|force-reload)
    restart
    ;;
  condrestart)
    [ -f /var/lock/subsys/<%= mongodb_name %> ] && restart || :
    ;;
  status)
    status $mongod
    RETVAL=$?
    ;;
  *)
    echo "Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
    RETVAL=1
esac

exit $RETVAL

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
uhl-cap-recipes-0.2.11 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.2.10 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.10 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.9 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.8 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.7 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.6 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.5 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.4 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.3 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.2 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.1 lib/cap_recipes/tasks/templates/mongodb.init.erb
uhl-cap-recipes-0.1.0 lib/cap_recipes/tasks/templates/mongodb.init.erb
crazycode-cap-recipes-0.5.3 lib/cap_recipes/tasks/templates/mongodb.init.erb
crazycode-cap-recipes-0.5.2 lib/cap_recipes/tasks/templates/mongodb.init.erb
crazycode-cap-recipes-0.5.1 lib/cap_recipes/tasks/templates/mongodb.init.erb
crazycode-cap-recipes-0.5.0 lib/cap_recipes/tasks/templates/mongodb.init.erb
crazycode-cap-recipes-0.4.14 lib/cap_recipes/tasks/templates/mongodb.init.erb
crazycode-cap-recipes-0.4.13 lib/cap_recipes/tasks/templates/mongodb.init.erb
crazycode-cap-recipes-0.4.12 lib/cap_recipes/tasks/templates/mongodb.init.erb