Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # Startup script for the Redmine
  4. # chkconfig: 2355 66 33
  5. # processname: thin
  6. # pidfile: /tmp/thin.3000.pid
  7.  
  8. # Source function library.
  9. . /etc/rc.d/init.d/functions
  10.  
  11. # Source networking configuration.
  12. . /etc/sysconfig/network
  13.  
  14. [ -x /usr/local/bin/thin ] || exit 0
  15.  
  16. # See how we were called.
  17. case "$1" in
  18. start)
  19. echo -n "Starting Redmine: "
  20. export RAILS_ENV=production
  21. daemon /usr/local/bin/thin -C /etc/thin/redmine start
  22. RETVAL=$?
  23. echo
  24. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/redmine
  25. ;;
  26. stop)
  27. echo -n "Stopping Redmine: "
  28. kill -9 `cat /tmp/thin.0.pid`
  29. kill -9 `cat /tmp/thin.1.pid`
  30. kill -9 `cat /tmp/thin.2.pid`
  31. rm -f /tmp/thin.0.pid
  32. rm -f /tmp/thin.1.pid
  33. rm -f /tmp/thin.2.pid
  34. RETVAL=$?
  35. echo
  36. ### heres the fix... we gotta remove the stale files on restart
  37. [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/redmine
  38. ;;
  39. status)
  40. status redmine
  41. RETVAL=$?
  42. ;;
  43. restart)
  44. $0 stop
  45. $0 start
  46. RETVAL=$?
  47. ;;
  48. *)
  49. echo "Usage: redmine {start|stop|status|restart}"
  50. exit 1
  51. esac
  52.  
  53. exit $RETVAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement