Advertisement
Guest User

Untitled

a guest
Aug 29th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. #! /bin/bash
  2. ### BEGIN INIT INFO
  3. # Provides: searchd
  4. # Required-Start: $remote_fs $syslog
  5. # Required-Stop: $remote_fs $syslog
  6. # Should-Start: $local_fs
  7. # Should-Stop: $local_fs
  8. # Default-Start: 2 3 4 5
  9. # Default-Stop: 0 1 6
  10. # Short-Description: Start searchd daemon
  11. # Description: Start up searchd, sphinx search daemon
  12. ### END INIT INFO
  13.  
  14. PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
  15. pidfile=/run/sphinx/searchd.pid
  16. binpath=/usr/local/bin/searchd
  17. SPHINX="--config /etc/sphinxsearch/sphinx.conf"
  18.  
  19. NAME=searchd
  20. DESC="sphinx search daemon"
  21.  
  22. test -f $binpath || exit 0
  23.  
  24. set -e
  25.  
  26. . /lib/lsb/init-functions
  27.  
  28. case "$1" in
  29. start)
  30. echo "Starting sphinx search daemon: searchd"
  31. start-stop-daemon --start --quiet --chuid 999 --group 999 --exec $binpath -- $SPHINX
  32. echo "."
  33. ;;
  34. stop)
  35. echo "Stopping sphinx search daemon: searchd"
  36. start-stop-daemon --stop --chuid 999 --group 999 --retry TERM/1/TERM/1/TERM/4/KILL --quiet --exec $binpath --pidfile $pidfile
  37. echo "."
  38. ;;
  39. restart|force-reload)
  40. echo "Restarting sphinx search daemon: searchd"
  41. start-stop-daemon --stop --chuid 999 --group 999 --retry TERM/1/TERM/1/TERM/4/KILL --quiet --exec $binpath --pidfile $pidfile
  42. start-stop-daemon --start --chuid 999 --group 999 --quiet --exec $binpath -- $SPHINX
  43. echo "."
  44. ;;
  45. status)
  46. status_of_proc -p $pidfile "${binpath}" "searchd"
  47. ;;
  48. *)
  49. echo "Usage: /etc/init.d/sphinx {start|stop|restart|force-reload|status}"
  50. exit 1
  51. esac
  52.  
  53. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement