Guest User

Untitled

a guest
Mar 13th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #! /bin/sh
  2. #
  3. # chkconfig: - 55 45
  4. # description: The starling daemon is a network queue service.
  5. # processname: starling
  6.  
  7. # Standard LSB functions
  8. #. /lib/lsb/init-functions
  9.  
  10. # Source function library.
  11. . /etc/init.d/functions
  12.  
  13. # Check that networking is up.
  14. if [ "$NETWORKING" = "no" ]
  15. then
  16. exit 0
  17. fi
  18.  
  19. RETVAL=0
  20. prog="starling"
  21.  
  22. start () {
  23. echo -n $"Starting $prog: "
  24. # ensure that /var/run/starling has proper permissions
  25. chown <%= starling_user %> /var/run/starling
  26.  
  27. ulimit -n 8192
  28. daemon --pidfile /var/run/starling/starling.pid starling -d -u <%= starling_user %> -p <%= starling_port %> -P <%= starling_pid %> -h <%= ipaddress_eth1 %> -l starling-tampopo -vvv -t 300
  29.  
  30. RETVAL=$?
  31. echo
  32. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/starling
  33. }
  34. stop () {
  35. echo -n $"Stopping $prog: "
  36. killproc -p /var/run/starling/starling.pid /usr/bin/starling
  37. RETVAL=$?
  38. echo
  39. if [ $RETVAL -eq 0 ] ; then
  40. rm -f /var/lock/subsys/starling
  41. rm -f /var/run/starling.pid
  42. fi
  43. }
  44.  
  45. restart () {
  46. stop
  47. start
  48. }
  49.  
  50.  
  51. # See how we were called.
  52. case "$1" in
  53. start)
  54. start
  55. ;;
  56. stop)
  57. stop
  58. ;;
  59. status)
  60. status starling
  61. ;;
  62. restart|reload|force-reload)
  63. restart
  64. ;;
  65. condrestart)
  66. [ -f /var/lock/subsys/starling ] && restart || :
  67. ;;
  68. *)
  69. echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
  70. exit 1
  71. esac
  72.  
  73. exit $?
Add Comment
Please, Sign In to add comment