# chkconfig: 2345 90 10
成都創(chuàng)新互聯(lián)公司主營呼蘭網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,成都app開發(fā),呼蘭h5重慶小程序開發(fā)搭建,呼蘭網(wǎng)站營銷推廣歡迎呼蘭等地區(qū)企業(yè)咨詢
# description: redis is a persistent key-value database
PATH=$PATH:/usr/local/redis/bin:/sbin:/usr/bin:/bin
REDISPORT=6379
EXEC=/usr/local/redis/bin/redis-server
REDIS_CLI=/usr/local/redis/bin/redis-cli
PASS=chbin123
PIDFILE=/var/run/redis_6379.pid
CONF="/usr/local/redis/etc/redis.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
if [ "$?"="0" ]
then
echo "Redis is running..."
fi
;;
stop)
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE does not exist, process is not running"
else
PID=$(cat $PIDFILE)
echo "Stopping ..."
$REDIS_CLI -a $PASS -p $REDISPORT SHUTDOWN
while [ -x ${PIDFILE} ]
do
echo "Waiting for Redis to shutdown ..."
sleep 1
done
echo "Redis stopped"
fi
;;
restart|force-reload)
${0} stop
${0} start
;;
*)
echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2
exit 1
esac
-----------------------------
添加redis服務(wù)開機(jī)啟動:
chmod +x /etc/init.d/redis
啟動redis服務(wù):
service redis start
檢查服務(wù)是否啟動
ps -ef | grep redis
netstat -anptu | grep 6379
新聞標(biāo)題:Redis啟動腳本,開機(jī)自動啟動
路徑分享:http://aaarwkj.com/article30/igepso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPT、響應(yīng)式網(wǎng)站、手機(jī)網(wǎng)站建設(shè)、軟件開發(fā)、標(biāo)簽優(yōu)化、網(wǎng)站營銷
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)