init.d.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #! /bin/sh
  2. #
  3. # Copyright (c) 2008 Urbacon Ltd.
  4. #
  5. # System startup script for the RubyCAS-Server
  6. #
  7. # Instructions:
  8. # 1. Rename this file to 'rubycas-server'
  9. # 2. Copy it to your '/etc/init.d' directory
  10. # 3. chmod +x /etc/init.d/rubycas-server
  11. #
  12. # chkconfig - 85 15
  13. # description: Provides single-sign-on authentication for web applications.
  14. #
  15. ### BEGIN INIT INFO
  16. # Provides: rubycas-server
  17. # Required-Start: $syslog
  18. # Should-Start:
  19. # Required-Stop: $syslog
  20. # Should-Stop:
  21. # Default-Start: 3 5
  22. # Default-Stop: 0 1 2 6
  23. # Description: Start the RubyCAS-Server
  24. ### END INIT INFO
  25. CASSERVER_CTL=rubycas-server-ctl
  26. # Gracefully exit if the controller is missing.
  27. which $CASSERVER_CTL > /dev/null || exit 0
  28. # Source config
  29. . /etc/rc.status
  30. rc_reset
  31. case "$1" in
  32. start)
  33. $CASSERVER_CTL start
  34. rc_status -v
  35. ;;
  36. stop)
  37. $CASSERVER_CTL stop
  38. rc_status -v
  39. ;;
  40. restart)
  41. $0 stop
  42. $0 start
  43. rc_status
  44. ;;
  45. status)
  46. $CASSERVER_CTL status
  47. rc_status -v
  48. ;;
  49. *)
  50. echo "Usage: $0 {start|stop|status|restart}"
  51. exit 1
  52. ;;
  53. esac
  54. rc_exit