/etc/init.d/redis-server
#!/bin/bash
#
#redis - this script starts and stops the redis-server daemon
#
# chkconfig: 235 90 10
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
redis="/usr/local/src/redis/src/redis-server"
prog=$(basename $redis)
REDIS_CONF_FILE="/etc/redis/redis.conf"
[ -f /etc/sysconfig/redis ] && . /etc/sysconfig/redis
lockfile=/var/lock/subsys/redis
start() {
[ -x $redis ] || exit 5
[ -f $REDIS_CONF_FILE ] || exit 6
echo -n $"Starting $prog: "
daemon $redis $REDIS_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog -QUIT
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading $prog: "
killproc $redis -HUP
RETVAL=$?
echo
}
force_reload() {
restart
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
'Linux' 카테고리의 다른 글
Jenkins Deploy Script (0) | 2014.06.25 |
---|---|
How to kill all process matching a name (0) | 2014.06.25 |
Real-time visitor analysis with Logstash + ElasticSearch + Kibana (0) | 2014.04.25 |
Ubuntu 텍스트 모드 화면 한글 설정 (0) | 2008.01.08 |
vim setting (0) | 2007.09.09 |
ubuntu에 Beryl 설치 하기 (1) | 2007.04.08 |
ubuntu와 무선랜과의 전쟁에 결말은? (0) | 2007.04.08 |
Ubuntu와의 전쟁 시작. (1) | 2007.04.07 |