/contrib/galaxy.debian-init

https://bitbucket.org/cistrome/cistrome-harvard/ · Bash · 55 lines · 45 code · 10 blank · 0 comment · 0 complexity · 491c5804dd899a718ab0f0a9aaaffdaa MD5 · raw file

  1. #!/bin/bash
  2. # Author: James Casbon, 2009
  3. ### BEGIN INIT INFO
  4. # Provides: galaxy
  5. # Required-Start: $network $local_fs $mysql
  6. # Required-Stop:
  7. # Default-Start: 2 3 4 5
  8. # Default-Stop: 0 1 6
  9. # Short-Description: Galaxy
  10. ### END INIT INFO
  11. . /lib/lsb/init-functions
  12. USER="galaxy"
  13. GROUP="nogroup"
  14. DIR="/home/galaxy/galaxy_dist/"
  15. PYTHON="/usr/bin/python"
  16. OPTS="-ES ./scripts/paster.py serve --log-file /home/galaxy/galaxy.log universe_wsgi.ini"
  17. PIDFILE="/var/run/galaxy.pid"
  18. case "${1:-''}" in
  19. 'start')
  20. log_daemon_msg "Starting Galaxy"
  21. if start-stop-daemon --chuid $USER --group $GROUP --start --make-pidfile \
  22. --pidfile $PIDFILE --background --chdir $DIR --exec $PYTHON -- $OPTS; then
  23. log_end_msg 0
  24. else
  25. log_end_msg 1
  26. fi
  27. ;;
  28. 'stop')
  29. log_daemon_msg "Stopping Galaxy"
  30. if start-stop-daemon --stop --pidfile $PIDFILE; then
  31. log_end_msg 0
  32. else
  33. log_end_msg 1
  34. fi
  35. ;;
  36. 'restart')
  37. # restart commands here
  38. $0 stop
  39. $0 start
  40. ;;
  41. *) # no parameter specified
  42. echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
  43. exit 1
  44. ;;
  45. esac