首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >停止supervisord:关闭

停止supervisord:关闭
EN

Stack Overflow用户
提问于 2013-01-23 20:35:22
回答 7查看 101.6K关注 0票数 46

我尝试启动supervisor,但遇到错误。有人能帮上忙吗?谢谢

/etc/init.d/supervisord文件。

代码语言:javascript
复制
SUPERVISORD=/usr/local/bin/supervisord
SUPERVISORCTL=/usr/local/bin/supervisorctl
case $1 in
start)
        echo -n "Starting supervisord: "
        $SUPERVISORD
        echo
        ;;
stop)
        echo -n "Stopping supervisord: "
        $SUPERVISORCTL shutdown
        echo
        ;;
restart)
        echo -n "Stopping supervisord: "
        $SUPERVISORCTL shutdown
        echo
        echo -n "Starting supervisord: "
        $SUPERVISORD
        echo
        ;;
esac

然后运行这些

代码语言:javascript
复制
sudo chmod +x /etc/init.d/supervisord
sudo update-rc.d supervisord defaults
sudo /etc/init.d/supervisord start

并得到以下结论:

代码语言:javascript
复制
Stopping supervisord: Shut down

Starting supervisord: /usr/local/lib/python2.7/dist-packages/supervisor/options.py:286: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
Error: Another program is already listening on a port that one of our HTTP servers is configured to use.  Shut this program down first before starting supervisord.
For help, use /usr/local/bin/supervisord -h

Conf文件(位于/etc/supervisord.conf):

代码语言:javascript
复制
[unix_http_server]
file=/tmp/supervisor.sock; (the path to the socket file)

[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB       ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10          ; (num of main logfile rotation backups;default 10)
loglevel=info               ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false              ; (start in foreground if true;default false)
minfds=1024                 ; (min. avail startup file descriptors;default 1024)
minprocs=200                ; (min. avail process descriptors;default 200)

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock; use a unix:// URL  for a unix socket

[program:myproject]
command=/home/richard/envs/myproject_stage/bin/python /home/richard/webapps/myproject/manage.py run_gunicorn -b 127.0.0.1:8002 --log-file=/tmp/myproject_stage_gunicorn.log
directory=/home/richard/webapps/myproject/
user=www-data
autostart=true
autorestart=true
stdout_logfile=/tmp/myproject_stage_supervisord.log
redirect_stderr=true
EN

回答 7

Stack Overflow用户

发布于 2014-05-07 05:56:44

首先,在您的控制台或终端上键入以下内容

代码语言:javascript
复制
ps -ef | grep supervisord

你会得到一些pid的监督令,就像这样

根目录2641 12938 0 04:52分/1 00:00:00 grep --color=自动主管顺序

根目录29646 1 0 04:45 ? 00:00:00 /usr/bin/python /usr/local/bin/supervisord

如果你得到这样的输出,你的pid就是第二个。然后,如果你想关闭你的主管命令,你可以这样做

代码语言:javascript
复制
kill -s SIGTERM 29646

希望能对你有所帮助。参考:http://supervisord.org/running.html#signals

票数 64
EN

Stack Overflow用户

发布于 2013-01-23 20:41:55

代码语言:javascript
复制
sudo unlink /tmp/supervisor.sock

在tmp的unix_http_server's文件配置值(缺省值为/ .sock /supervisor.sock)中定义此/etc/supervisord.conf文件。

票数 48
EN

Stack Overflow用户

发布于 2017-11-15 14:31:52

代码语言:javascript
复制
$ ps aux | grep supervisor
alexamil         54253   0.0  0.0  2506960   6440   ??  Ss   10:09PM   0:00.26 /usr/bin/python /usr/local/bin/supervisord -c supervisord.conf

所以我们可以使用:

代码语言:javascript
复制
$ pkill -f supervisord  # kill it
票数 18
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14479894

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档