Guest User

Untitled

a guest
May 25th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. #! /bin/sh
  2.  
  3. ### BEGIN INIT INFO
  4. # Provides: mongodb
  5. # Required-Start: $all
  6. # Required-Stop: $all
  7. # Default-Start: 2 3 4 5
  8. # Default-Stop: 0 1 6
  9. # Short-Description: starts the mongodb data-store
  10. # Description: starts mongodb using start-stop-daemon
  11. ### END INIT INFO
  12.  
  13. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  14. DAEMON=/usr/local/sbin/mongod
  15. PIDFILE=/usr/local/mongodb/logs/mongodb.pid
  16. LOGFILE=/usr/local/mongodb/logs/mongod.log
  17. NAME=mongodb
  18. DESC=mongodb
  19.  
  20. test -x $DAEMON || exit 0
  21.  
  22. #set -e
  23.  
  24. case "$1" in
  25. start)
  26. echo -n "Starting $DESC: "
  27. start-stop-daemon --pidfile $PIDFILE --exec $DAEMON --start -- run >> $LOGFILE&
  28. echo "$NAME."
  29. ;;
  30. stop)
  31. echo -n "Stopping $DESC: "
  32. start-stop-daemon --quiet --pidfile $PIFDILE --exec $DAEMON --stop
  33. echo "$NAME."
  34. ;;
  35. restart|force-reload)
  36. echo -n "Restarting $DESC: "
  37. start-stop-daemon --quiet --pidfile $PIDFILE --exec $DAEMON --stop
  38. sleep 1
  39. start-stop-daemon --quiet --pidfile $PIDFILE --exec $DAEMON --start -- run >> $LOGFILE&
  40. echo "$NAME."
  41. ;;
  42. reload)
  43. echo -n "Reloading $DESC configuration: "
  44. start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --exec $DAEMON
  45. echo "$NAME."
  46. ;;
  47. *)
  48. N=/etc/init.d/$NAME
  49. echo "Usage: $N {start|stop|restart|force-reload}" >&2
  50. exit 1
  51. ;;
  52. esac
  53.  
  54. exit 0
Add Comment
Please, Sign In to add comment