【问题标题】:debian redis update-rc.d errors - there is a loop between redis and nginxdebian redis update-rc.d 错误 - redis 和 nginx 之间存在循环
【发布时间】:2016-10-25 15:38:35
【问题描述】:

尝试按照http://redis.io/topics/quickstart 的说明在 debian 7 wheezy(redis 版本 7)中将 redis 作为服务安装

但是在运行 sudo update-rc.d redis_6379 defaults 之后

我收到这些错误

update-rc.d: using dependency based boot sequencing
insserv: warning: script 'redis_6379' missing LSB tags and overrides
insserv: There is a loop between service nginx and redis_6379 if stopped
insserv:  loop involving service redis_6379 at depth 2
insserv:  loop involving service nginx at depth 1
insserv: Stopping redis_6379 depends on nginx and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header

Nginx init.d 是

#! /bin/sh

### BEGIN INIT INFO
# Provides:          nginx
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the nginx web server
# Description:       starts nginx using start-stop-daemon
### END INIT INFO

PATH=/opt/nginx/sbin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/opt/nginx/sbin/nginx
NAME=nginx
DESC=nginx

test -x $DAEMON || exit 0

# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
        . /etc/default/nginx
fi

set -e

Redis init.d 是

#!/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="/etc/redis/${REDISPORT}.conf"

【问题讨论】:

    标签: linux ubuntu nginx redis debian


    【解决方案1】:

    尝试将标头添加到/etc/init.d/redis_6379

    ### BEGIN INIT INFO
    # Provides: redis_6379
    # Required-Start:    $network $remote_fs $local_fs
    # Required-Stop:     $network $remote_fs $local_fs
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: start and stop redis_6379
    # Description: Redis daemon
    ### END INIT INFO
    

    然后运行

    sudo update-rc.d redis_6379 defaults
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-09-12
      • 1970-01-01
      • 2021-05-06
      • 2011-10-17
      • 2021-09-20
      • 2012-09-30
      相关资源
      最近更新 更多