首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >supervisord错误:用户名无效

supervisord错误:用户名无效
EN

Stack Overflow用户
提问于 2015-03-03 11:58:07
回答 2查看 8K关注 0票数 3

我正在尝试根据article使用golang web app配置supervisord。但在运行命令sudo supervisord -c /etc/supervisor/supervisord.conf时出现错误

代码语言:javascript
复制
Error: Invalid username deploy user # the user your app should run as (i.e. *not* root!)

我创建了用户deployuser并将其添加到组supervisor

代码语言:javascript
复制
sudo adduser deployser supervisor

Supervisord配置文件是

代码语言:javascript
复制
[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0770                       ; sockef file mode (default 0700)
chown=root:supervisor            ; add our group
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

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

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

[include]
files = /etc/supervisor/conf.d/*.conf

我将用户deployuser添加到我的应用配置文件中:

代码语言:javascript
复制
[program:myGolangApp]
command=/root/path/to/my/go/lang/app/myGolangApp # the location of your app
autostart=true
autorestart=true
startretries=10
user=deployuser # the user your app should run as (i.e. *not* root!)
directory=/root/path/to/my/go/lang/app/ # where your application runs from
environment=APP_SETTINGS="/srv/www/yourapp.com/prod.toml" # environmental variables
redirect_stderr=true
stdout_logfile=/var/log/supervisor/myGolangApp.log # the name of the log file.
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=10

我的操作系统是ubuntu服务器。并且我正在以root用户身份进行所有配置。

EN

回答 2

Stack Overflow用户

发布于 2015-04-18 13:41:04

尝试更改第二个注释(# ->;)中的注释样式以匹配第一个样式。我在文档中找不到,但他们似乎没有使用"#“作为注释。

整个配置行似乎都存在错误,这似乎真的很可疑。如果它被正确解析,它将只包含一个错误值,而不是注释。

票数 6
EN

Stack Overflow用户

发布于 2015-04-18 16:18:52

看起来你打错了:deployserdeployuser

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28823850

复制
相关文章

相似问题

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