Remove the service install flag to the agent as it's not really
neccessary; the standard daemon invocation will achieve the same result.
Also add a check in loader runs to see if the agent is running even if
no changes were needed. If not, try to start the agent. This handles
cases where the loader doesnt need to make changes, but the agent is not
running for some reason, and prior the loader would not attempt to
recover this scenario.
If Init returns an error because it cannot initialize the log, this
fixes an issue where a channel write will be attempted causing the agent
to block indefinitely
Checkpoint commit for initial revision of mig-loader related code. This
change adds functionality supporting agent auto-update using manifests
stored in the API.
This resolves a bug introduced in e2e687f. The args parameter to
runModuleDirectly() used to contain input parameters, but as of recent
changes to allow parameters via stdin does not.
Since the parameter was unused, this changes it to be an interface
pointer. If set, this will be used as module parameters, if not the
agent modules will expect input via stdin as normal.
I'm applying the changes suggested in PR #139 by @jvehent; these make
runModuleDurectly to not use stdin, instead only use the given
parameters.
Now travis-ci should test mig-agent after installing to see that it can
run an action individually.
If an error ocurred during configLoad function, it might not use the
builtin conf, but a half-overwritten one. This change defers the
Config overwrite until all the error-sensitive functions are called.
The comment said "if in foreground mode, don't retry, just panic", but
fhe if condition only checked for debug, no foreground.
debug -> foreground, but you can run the mig agent in foreground without
debug mode.
There was an ioutil.WriteFile whose permissions were not in octal, giving
the resulting file bad permissions.
This commit also changes some of the printf formats from '%s' to %q,
which already quotes the desired variable.