我想配置supervisord有golang web app根据的文章.但是当我运行命令时出错sudo supervisord -c /etc/supervisor/supervisord.conf:
Error: Invalid username deploy user # the user your app should run as (i.e. *not* root!)
Run Code Online (Sandbox Code Playgroud)
我创建了用户deployuser并将其添加到组中supervisor
sudo adduser deployser supervisor
Run Code Online (Sandbox Code Playgroud)
Supervisord配置文件是
[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
Run Code Online (Sandbox Code Playgroud)
我将用户添加deployuser到我的应用配置文件中:
[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
Run Code Online (Sandbox Code Playgroud)
我的操作系统是ubuntu服务器.我正在以root身份登录所有配置.
小智 6
尝试更改第二个注释(# - >;)中的注释样式以匹配第一个样式.我在文档中找不到它,但它们似乎没有使用"#"作为评论.
整个配置行出现错误似乎真的很可疑.如果它已正确解析,它将只包含错误值,而不是注释.
| 归档时间: |
|
| 查看次数: |
6674 次 |
| 最近记录: |