-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy path628-redis-init-deb.sh
More file actions
44 lines (34 loc) · 989 Bytes
/
628-redis-init-deb.sh
File metadata and controls
44 lines (34 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
### BEGIN INIT INFO
# Provides: redis
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts redis database system
# Description: starts redis using basic start scripts
### END INIT INFO
PATH=/opt/redis/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=redis
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --user redis -c redis:redis \
--startas /opt/redis/redis-server -- /opt/redis/redis.conf
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --exec /opt/redis/redis-server -c redis:redis \
/opt/redis/redis-server -- /opt/redis/redis.conf
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop}" >&2
exit 1
;;
esac
exit 0