summaryrefslogtreecommitdiff
path: root/dev-db/redis/files/redis.initd-3
blob: a7a7713fd66580a8ae9d5d3b174a6d63cdc12c8b (plain)
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
#!/sbin/runscript
# $Header: /var/cvsroot/gentoo-x86/dev-db/redis/files/redis.initd-3,v 1.1 2013/08/26 11:47:13 djc Exp $

REDIS_DIR=${REDIS_DIR:-/var/lib/redis}
REDIS_CONF=${REDIS_CONF:-/etc/redis.conf}
REDIS_OPTS=${REDIS_OPTS:-"${REDIS_CONF}"}
REDIS_USER=${REDIS_USER:-redis}
REDIS_GROUP=${REDIS_GROUP:-redis}

command=/usr/sbin/redis-server
start_stop_daemon_args="--chdir \"${REDIS_DIR}\"
	--user ${REDIS_USER} --group ${REDIS_GROUP}"
command_args="${REDIS_OPTS}"
pidfile=${REDIS_PID:-/run/redis/redis.pid}

depend() {
	use net localmount logger
	after keepalived
}

start_pre() {
	checkpath -d -m 0775 -o ${REDIS_USER}:${REDIS_GROUP} $(dirname ${REDIS_PID})
}

stop() {
	ebegin "Stopping ${SVCNAME}"
	start-stop-daemon --stop \
		--exec ${retries} \
		--retry 30 \
		--pidfile ${pidfile}
	eend
}