错误:不支持位置参数

问题描述 投票:9回答:5
[program:sam_reports_uwsgi]
command=uwsgi --ini /var/www/phis-ng/server_config/staging_wsgi.ini
autostart=true
autorestart=true
stopsignal=QUIT
stdout_logfile=/var/log/sam_reports/stdout.log
stderr_logfile=/var/log/sam_reports/stderr.log
user=ubuntu
directory=/var/www/phis-ng/src/imam

这是我为supervisord提供的conf文件,但是当我尝试在它所在的文件夹中运行supervisord staging_supervisor.conf时,它给了我这个错误:

Error: positional arguments are not supported

我无法看到我将其与我通过Google和supervisord docs发现的内容进行比较时所做的错误。我正在使用supervisord 3.0。

uwsgi supervisord
5个回答
4
投票

更改:

ENTRYPOINT ["/usr/bin/supervisord"]

CMD ["/usr/bin/supervisord"]

不幸的是还不能解释为什么这有帮助。


0
投票

您在配置文件之前缺少-c。它认为配置文件是一个“位置参数”。


0
投票

确保supervisord作为守护进程运行,并为每个程序尝试supervisorctl

对于ubuntu,创建包含/etc/supervisord/conf.d/some_app.conf部分的[program:some_app]文件。

然后,开始吧。

supervisorctl reload
supervisorctl start some_app

确认它正在运行

supervisorctl status

就这样。


0
投票

ENTYRPOINT替换CMD是一种光滑的解决方案,因为当容器使用命令运行时,例如docker run -it IMAGE /bin/bashCMD被忽略了。它可能适用于小型Dockerfiles,但是在更大层次的情况下,它可能很难调试。但我找到了一个解决方案,使用ENTRYPOINTsupervisord避免错误位置参数不支持错误。只需将supervisord命令放在shell脚本.sh中,将其复制到容器中,然后在该文件上使用ENTRYPOINT,例如:

润_supervisor的.是

#!/bin/bash
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

Dockerfile:

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY image_scripts/run_supervisord.sh /opt/bin/run_supervisord.sh
ENTRYPOINT ["bash", "/opt/bin/run_supervisord.sh"]

-1
投票

不知何故,supervisord需要CMD指令。那么,你可以写得像威尔:

CMD []
ENTRYPOINT ["supervisord", "-n", "-c", "/etc/supervisord.conf"]
© www.soinside.com 2019 - 2024. All rights reserved.