mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Improve Orbit debug logging (#3687)
Log reasons for runners terminating.
This commit is contained in:
parent
dc8e7cd4db
commit
ef42199c57
@ -382,7 +382,7 @@ func main() {
|
||||
}
|
||||
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
log.Error().Err(err).Msg("run orbit failed")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ func WithLogPath(path string) func(*Runner) error {
|
||||
// process may not be restarted after exit. Instead create a new one with
|
||||
// NewRunner.
|
||||
func (r *Runner) Execute() error {
|
||||
log.Info().Str("cmd", r.cmd.String()).Msg("run osqueryd")
|
||||
log.Info().Str("cmd", r.cmd.String()).Msg("start osqueryd")
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
r.cancel = cancel
|
||||
@ -139,7 +139,7 @@ func (r *Runner) Execute() error {
|
||||
|
||||
// Runner interrupts the running osquery process.
|
||||
func (r *Runner) Interrupt(err error) {
|
||||
log.Debug().Msg("interrupt osquery")
|
||||
log.Debug().Err(err).Msg("interrupt osquery")
|
||||
r.cancel()
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,8 @@ func NewRunner(socket string) *Runner {
|
||||
|
||||
// Execute creates an osquery extension manager server and registers osquery plugins.
|
||||
func (r *Runner) Execute() error {
|
||||
log.Debug().Msg("start osquery extension")
|
||||
|
||||
if err := waitForSocket(r.socket, 1*time.Minute); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -75,7 +77,7 @@ func (r *Runner) Execute() error {
|
||||
|
||||
// Interrupt shuts down the osquery manager server.
|
||||
func (r *Runner) Interrupt(err error) {
|
||||
log.Debug().Msg("interrupt osquery extension")
|
||||
log.Debug().Err(err).Msg("interrupt osquery extension")
|
||||
r.cancel()
|
||||
|
||||
if r.srv != nil {
|
||||
|
@ -66,6 +66,8 @@ func NewRunner(client *Updater, opt RunnerOptions) (*Runner, error) {
|
||||
|
||||
// Execute begins a loop checking for updates.
|
||||
func (r *Runner) Execute() error {
|
||||
log.Debug().Msg("start updater")
|
||||
|
||||
ticker := time.NewTicker(r.opt.CheckInterval)
|
||||
defer ticker.Stop()
|
||||
|
||||
@ -150,5 +152,5 @@ func (r *Runner) updateTarget(target, channel string) error {
|
||||
|
||||
func (r *Runner) Interrupt(err error) {
|
||||
r.cancel <- struct{}{}
|
||||
log.Debug().Msg("interrupt updater")
|
||||
log.Debug().Err(err).Msg("interrupt updater")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user