S50redis 501 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. #
  3. # start redis
  4. #
  5. start() {
  6. printf "Starting redis: "
  7. umask 077
  8. start-stop-daemon -S -q -c redis:redis -b \
  9. --exec /usr/bin/redis-server -- /etc/redis.conf
  10. [ $? = 0 ] && echo "OK" || echo "FAIL"
  11. }
  12. stop() {
  13. printf "Stopping redis: "
  14. /usr/bin/redis-cli shutdown
  15. [ $? = 0 ] && echo "OK" || echo "FAIL"
  16. }
  17. restart() {
  18. stop
  19. start
  20. }
  21. case "$1" in
  22. start)
  23. start
  24. ;;
  25. stop)
  26. stop
  27. ;;
  28. restart|reload)
  29. restart
  30. ;;
  31. *)
  32. echo "Usage: $0 {start|stop|restart}"
  33. exit 1
  34. esac
  35. exit $?