2015-03-03 323 views
3

我試圖根據article配置supervisordgolang web app。但得到一個錯誤,當我運行命令sudo supervisord -c /etc/supervisor/supervisord.confsupervisord錯誤:無效的用戶名

Error: Invalid username deploy user # the user your app should run as (i.e. *not* root!) 

我創建的用戶deployuser並將其添加到組supervisor

sudo adduser deployser supervisor 

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 

我添加的用戶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 

我的操作系統是Ubuntu的服務器。我正在做所有以root身份登錄的配置。

回答

6

嘗試更改第二條評論(# - >;)中的評論風格以匹配第一個風格。我無法在文檔中找到它,但它們似乎沒有使用「#」作爲評論。

整個配置行出現錯誤似乎真的很可疑。如果分析正確,它只會包含一個錯誤值,而不是註釋。

+0

這個固定我的問題:-) – adredx 2015-04-18 13:10:11

4

好像你犯了一個錯字:deployserdeployuser