Commit c4286fea authored by quiver's avatar quiver
Browse files

fix several bugs of init.d scripts

- PIDFILE environ variable was not properly retrieved
- chkconfig command failed
parent 96e9f8d5
...@@ -166,7 +166,7 @@ if [[ ! `which chkconfig` ]] ; then ...@@ -166,7 +166,7 @@ if [[ ! `which chkconfig` ]] ; then
else else
# we're chkconfig, so lets add to chkconfig and put in runlevel 345 # we're chkconfig, so lets add to chkconfig and put in runlevel 345
chkconfig --add redis_$REDIS_PORT && echo "Successfully added to chkconfig!" chkconfig --add redis_$REDIS_PORT && echo "Successfully added to chkconfig!"
chkconfig--level 345 redis_$REDIS_PORT on && echo "Successfully added to runlevels 345!" chkconfig --level 345 redis_$REDIS_PORT on && echo "Successfully added to runlevels 345!"
fi fi
/etc/init.d/redis_$REDIS_PORT start || die "Failed starting service..." /etc/init.d/redis_$REDIS_PORT start || die "Failed starting service..."
......
case "$1" in case "$1" in
start) start)
if [ -f $$PIDFILE ] if [ -f $PIDFILE ]
then then
echo "$PIDFILE exists, process is already running or crashed" echo "$PIDFILE exists, process is already running or crashed"
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment