Update-rc.d:error:insserv拒绝了脚本头

问题描述 投票:1回答:1

所以我正在尝试将ka-lite安装到我的覆盆子pi上,当我安装时,我收到以下错误。我将手动运行runatboot.sh文件并获得相同的确切错误。我不知道该怎么做或如何解决这个问题。

我收到了这个错误

     sudo ./runatboot.sh
    update-rc.d: using dependency based boot sequencing
    insserv: warning: script 'start.sh' missing LSB tags and overrides
    insserv: There is a loop between service monit and start.sh if stopped
    insserv:  loop involving service start.sh at depth 2
    insserv:  loop involving service monit at depth 1
    insserv: Stopping start.sh depends on monit 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

这是我的start.sh文件

    cat start.sh
    #!/bin/bash
    ### BEGIN INIT INFO
    # Provides:          kalite
    ### END INIT INFO

    if [ "$(id -u)" = "0" ]; then
        echo "Error: KA-Lite must be started by a regular user, not by root"
        exit 1
    fi

    SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`
    if [ -e "$SCRIPT_DIR/python.sh" ]; then
        KALITE_DIR=$SCRIPT_DIR/../kalite
    else
        KALITE_DIR=$SCRIPT_DIR/kalite
        SCRIPT_DIR=$SCRIPT_DIR/scripts
    fi

    # move any previously downloaded content from the old location to the new
    mv "$KALITE_DIR/static/videos/*" "$KALITE_DIR/../content" > /dev/null 2> /dev/null

    echo
    source "$SCRIPT_DIR/serverstart.sh"

    echo
    source "$SCRIPT_DIR/cronstart.sh"

这是runatboot.sh文件

    cat runatboot.sh
    #!/bin/bash

    SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`
    KALITE_DIR=$SCRIPT_DIR/../kalite
    pyexec=`"$SCRIPT_DIR/python.sh"`

    UNAME=`uname`
    if [ "$UNAME" == "Darwin" ]; then
        F=/$HOME/Library/LaunchAgents/org.learningequality.kalite.plist
        "$pyexec" "$KALITE_DIR/manage.py" initdconfig > "$F"
        chmod 644 "$F"
    elif [ "$UNAME" == "Linux" ]; then
        "$pyexec" "$KALITE_DIR/manage.py" initdconfig > /etc/init.d/kalite
        chmod 755 /etc/init.d/kalite
        update-rc.d kalite defaults
    fi

谁能帮我吗?

bash autorun
1个回答
0
投票

insserv:警告:脚本'start.sh'缺少LSB标记和覆盖要删除上面的错误描述应该是这样的:

### BEGIN INIT INFO
# Provides:  <user entry>
# Required-Start: <user entry: please add even if empty.>
# Required-Stop: <user entry: please add even if empty.>
# Default-Start: 2 3 4 5
# Default-Stop:  0 1 6
# Short-Description: 
### END INIT INFO
© www.soinside.com 2019 - 2024. All rights reserved.