gpt4 book ai didi

supervisord - 停止supervisord : Shut down

转载 作者:行者123 更新时间:2023-12-03 07:35:39 25 4
gpt4 key购买 nike

我厌倦了启动主管,但出现错误。有人可以帮忙吗?谢谢

/etc/init.d/supervisord 文件。

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

然后运行这些

sudo chmod +x /etc/init.d/supervisord
sudo update-rc.d supervisord defaults
sudo /etc/init.d/supervisord start

得到这个:

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):

[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

最佳答案

首先,在控制台或终端上输入此内容

ps -ef | grep supervisord

你会得到一些supervisord的pid,就像这些

root 2641 12938 0 04:52 pts/1 00:00:00 grep --color=auto supervisord

root 29646 1 0 04:45 ? 00:00:00 /usr/bin/python /usr/local/bin/supervisord

如果你得到这样的输出,你的 pid 就是第二个。那么如果你想关闭你的supervisord你可以这样做

kill -s SIGTERM 29646

希望对您有帮助。引用:http://supervisord.org/running.html#signals

关于supervisord - 停止supervisord : Shut down,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14479894/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com