You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in this case, cmds like install/enable/disable/uninstall wouldn't be logging to this path, but I think we should write a shim for those as well (that doesn't daemonize).
I want this shim because waagent does not collect child processes (e.g. extensions) logs from their stdout/stderr and expects them to write to a LogFolder specified in HandlerEnvironment.json.
This is quite against the unix philosophy (processes logging themselves to the files) and it's also not reliable as the go process panics, it won't be able to log the panic. But if we have a shim (written in bash script) we can collect the crash logs as well into a file with a simple .. | tee -a redirection.
we could theoretically keep the daemonizing inside the enable() code and the shim would just redirect the logs... however, golang has issues with daemonizing. golang/go#227 there are libraries to address: https://github.com/sevlyar/go-daemon but this solution seems like an overkill where we could just use 2 lines of bash script to double-exec.
I am planning to write a bash script shim that
enable
commandenable
command to a static location e.g./var/log/azure/custom-script/handler.log
an example of this is here: https://github.com/Azure/azure-docker-extension/blob/master/scripts/run-in-background.sh
in this case, cmds like install/enable/disable/uninstall wouldn't be logging to this path, but I think we should write a shim for those as well (that doesn't daemonize).
I want this shim because waagent does not collect child processes (e.g. extensions) logs from their stdout/stderr and expects them to write to a LogFolder specified in HandlerEnvironment.json.
This is quite against the unix philosophy (processes logging themselves to the files) and it's also not reliable as the go process panics, it won't be able to log the panic. But if we have a shim (written in bash script) we can collect the crash logs as well into a file with a simple
.. | tee -a
redirection.@boumenot what do you think?
The text was updated successfully, but these errors were encountered: