2017-05-28 86 views
0

我想以ip地址作爲參數運行我的服務器。與supervisord執行子命令

./server-no-ssl 80 "$(curl http://169.254.169.254/latest/meta-data/public-hostname)" 

我使用監裝配置

[program:allsparkrt] 
command=/home/ubuntu/server-no-ssl 80 "$(curl http://169.254.169.254/latest/meta-data/public-hostname)" 
directory=/home/ubuntu/ 
autostart=true 
autorestart=true 
startretries=3 
stderr_logfile=/var/log/allspark_server.err.log 
stdout_logfile=/var/log/allspark_server.out.log 
stopsignal=INT 
stopwaitsecs=60 

curl命令被作爲參數,而不是從捲曲IP地址。 幫助讚賞。

回答

1

Supervisord不爲指定的命令執行shell,因此curl不被視爲命令,而僅作爲字符串處理。請查看answer瞭解更多詳情。作爲解決方法,您可以嘗試使用bash -c "desired command"構造。