CentOS7 下redis不能开机启动,求解?
过去多啦不再A梦
过去多啦不再A梦 2017-04-25 09:03:30
0
3
692

我的/etc/init.d/redis 脚本可以正常启动或者停止redis服务

service redis start
service redis stop
service redis restart

我也设置了/etc/init.d/redis权限为755
也设置了开机启动chkconfig redis on

chkconfig --list如下:

redis              0:关    1:关    2:开    3:开    4:开    5:开    6:关

请问为什么不能开机启动呢?求解决办法

附:/etc/init.d/redis代码如下:

# chkconfig: 2345 10 90
#!/bin/sh
#
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.

REDISPORT=6379
EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli

PIDFILE=/var/run/redis_${REDISPORT}.pid
CONF="/usr/local/redis/redis.conf"
AUTH="111111"
# CONF="/etc/redis/${REDISPORT}.conf"

case "$1" in
    start)
        if [ -f $PIDFILE ]
        then
                echo "$PIDFILE exists, process is already running or crashed"
        else
                echo "Starting Redis server..."
                $EXEC $CONF
        fi
        ;;
    stop)
        if [ ! -f $PIDFILE ]
        then
                echo "$PIDFILE does not exist, process is not running"
        else
                PID=$(cat $PIDFILE)
                echo "Stopping ..."
                $CLIEXEC -p $REDISPORT -a $AUTH shutdown
                while [ -x /proc/${PID} ]
                do
                    echo "Waiting for Redis to shutdown ..."
                    sleep 1
                done
                echo "Redis stopped"
        fi
        ;;
    restart|force-reload)
        ${0} stop
        ${0} start
        ;;
    *)
        echo "Please use start or stop as first argument"
        ;;
esac
过去多啦不再A梦
过去多啦不再A梦

membalas semua(3)
给我你的怀抱

Saya merujuk kepada fail permulaan yang disediakan oleh php-fpm dan menambahkan ayat ini untuk menyelesaikannya. Saya tidak tahu mengapa

### BEGIN INIT INFO
# Provides:          redis
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts redis
# Description:       starts the redis FastCGI Process Manager daemon
### END INIT INFO
仅有的幸福

Tengok log, mungkin ralat

仅有的幸福

Jika itu tidak berkesan, tambahkan sahaja: /etc/rc.local sebelum exit dalam sudo service redis-server start.

Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!