confd icon indicating copy to clipboard operation
confd copied to clipboard

Always log reload_cmd output

Open hazcod opened this issue 7 years ago • 3 comments

my confd:

[template]
src = "nginx.conf.tmpl"
dest = "tmp/nginx.conf"
owner = "app"
mode = "0400"
keys = [
	"xxx",
]
reload_cmd = "nginx -g 'error_log /dev/stdout;' -p /app -c /app/tmp/nginx.conf"

But the output of nginx is never shown. Ideas? I feel like it will only log once the command is finished? My CMD directly executes confd.

Edit: I feel like I might be abusing the test command here. Would it be possible to implement a positional -exec argument?

e.g. confd -conf / -exec "nginx -p /app" will execute nginx -p /app when successfully ran.

hazcod avatar Mar 06 '19 10:03 hazcod

Why not just use confd ... && nginx ...?

hubo1016 avatar Mar 19 '19 02:03 hubo1016

That requires a shell.

hazcod avatar Mar 19 '19 06:03 hazcod

I think it SHOULD be solved with a shell...

Use sh -c 'confd ... && exec nginx ...' so nginx replaces the shell.

hubo1016 avatar Mar 19 '19 15:03 hubo1016