使用 supervisord 执行子命令
executing subcommand with supervisord
我想 运行 我的服务器以 ip 地址作为参数。
./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 命令作为参数而不是 curl 的 ip 地址。
帮助表示赞赏。
Supervisord 不会对指定命令执行 shell,因此 curl 不会被视为命令,而只会被视为字符串。查看此 answer 了解更多详情。作为解决方法,您可以尝试使用 bash -c "desired command"
构造。
我想 运行 我的服务器以 ip 地址作为参数。
./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 命令作为参数而不是 curl 的 ip 地址。 帮助表示赞赏。
Supervisord 不会对指定命令执行 shell,因此 curl 不会被视为命令,而只会被视为字符串。查看此 answer 了解更多详情。作为解决方法,您可以尝试使用 bash -c "desired command"
构造。