【问题标题】:confuse about the parameter in starting the supervisord对启动supervisord的参数感到困惑
【发布时间】:2017-05-31 07:36:19
【问题描述】:

有人可以帮助我吗,我正在 centos 中安装主管。我的问题是当我启动supervisord时,我使用这个supervisord -c /etc/supervisord.conf然后我可以supervisorctl start myapp:*。我的后台脚本正在运行,但如果我喜欢这个service supervisord start。它不起作用我不能使用这个命令supervisorctl start myapp:*,因为它会引发错误myapp: ERROR (no such group)

我的问题是,当我的服务器重新启动时,我无法立即启动我的主管。我需要再次执行supervisord -c /etc/supervisord.conf。请有人帮我解决这个异常配置。

提前谢谢你。

【问题讨论】:

    标签: php supervisord


    【解决方案1】:

    您是否更新了您的 supervisord 配置?如果没有,请尝试使用下面的脚本..

    $ sudo vi /etc/init.d/supervisord

    #!/bin/bash
    
    . /etc/init.d/functions
    
    DAEMON=/usr/bin/supervisord
    PIDFILE=/var/run/supervisord.pid
    
    [ -x "$DAEMON" ] || exit 0
    
    start() {
            echo -n "Starting supervisord: "
            if [ -f $PIDFILE ]; then
                    PID=`cat $PIDFILE`
                    echo supervisord already running: $PID
                    exit 2;
            else
                    daemon  $DAEMON --pidfile=$PIDFILE -c /etc/supervisord.conf
                    RETVAL=$?
                    echo
                    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/supervisord
                    return $RETVAL
            fi
    
    }
    
    stop() {
            echo -n "Shutting down supervisord: "
            echo
            killproc -p $PIDFILE supervisord
            echo
            rm -f /var/lock/subsys/supervisord
            return 0
    }
    
    case "$1" in
        start)
            start
            ;;
        stop)
            stop
            ;;
        status)
            status supervisord
            ;;
        restart)
            stop
            start
            ;;
        *)
            echo "Usage:  {start|stop|status|restart}"
            exit 1
            ;;
    esac
    exit $?
    

    接下来,运行 chkconfig 命令,它允许配置服务在 Linux 启动期间自动启动和停止。

    $ chkconfig --add supervisord
    $ chkconfig supervisord --level 345 on
    

    更多参考:
    http://www.aboutlinux.info/2006/04/enabling-and-disabling-services-during_01.html https://serverfault.com/questions/96499/how-to-automatically-start-supervisord-on-linux-ubuntu

    【讨论】:

    • 我有同样的问题 - 我尝试在命令行上运行“chkconfig --add supervisord”并收到“service supervisord does not support chkconfig”
    • 您的系统中安装了 supervisord 吗?如果不按此步骤操作:supervisord.org/installing.html
    【解决方案2】:

    已修复 - 确保您在 supervisord 脚本的顶部有这个:

    #!/bin/bash
    #
    # /etc/rc.d/init.d/supervisord
    #
    # Supervisor is a client/server system that
    # allows its users to monitor and control a
    # number of processes on UNIX-like operating
    # systems.
    #
    # chkconfig: - 64 36
    # description: Supervisor Server
    # processname: supervisord
    

    通过这些设置,脚本可以正确识别

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-10
      • 2015-09-05
      • 1970-01-01
      • 2020-12-06
      • 1970-01-01
      • 1970-01-01
      • 2021-06-24
      相关资源
      最近更新 更多