Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | ### BEGIN INIT INFO |
| 4 | # Provides: redis-server |
| 5 | # Required-Start: $network |
| 6 | # Required-Stop: $network |
| 7 | # Default-Start: S 2 3 4 5 |
| 8 | # Default-Stop: 0 1 6 |
| 9 | # Short-Description: Redis, a key-value store |
| 10 | # Description: Redis is an open source, advanced key-value store. |
| 11 | # http://redis.io |
| 12 | ### END INIT INFO |
| 13 | |
| 14 | test -f /usr/bin/redis-server || exit 0 |
| 15 | |
| 16 | ARGS="/etc/redis/redis.conf" |
| 17 | |
| 18 | case "$1" in |
| 19 | start) |
| 20 | echo "Starting redis-server..." |
| 21 | start-stop-daemon --start --quiet --exec /usr/bin/redis-server -- $ARGS |
| 22 | ;; |
| 23 | stop) |
| 24 | echo "Stopping redis-server..." |
| 25 | start-stop-daemon --stop --quiet --exec /usr/bin/redis-server |
| 26 | ;; |
| 27 | restart) |
| 28 | echo "Stopping redis-server..." |
| 29 | start-stop-daemon --stop --quiet --exec /usr/bin/redis-server |
| 30 | echo "Starting redis-server..." |
| 31 | start-stop-daemon --start --quiet --exec /usr/bin/redis-server -- $ARGS |
| 32 | ;; |
| 33 | *) |
| 34 | echo "Usage: /etc/init.d/redis-server {start|stop|restart}" |
| 35 | exit 1 |
| 36 | ;; |
| 37 | esac |
| 38 | |
| 39 | exit 0 |
| 40 | |