diff --git a/cmd/incus-agent/daemon.go b/cmd/incus-agent/daemon.go index 2ab4997dd..7979f9631 100644 --- a/cmd/incus-agent/daemon.go +++ b/cmd/incus-agent/daemon.go @@ -8,9 +8,10 @@ import ( // A Daemon can respond to requests from a shared client. type Daemon struct { - // Event servers + // Event servers. events *events.Server + // Paths. secretsLocation string // ContextID and port of the host socket server. diff --git a/cmd/incus-agent/main.go b/cmd/incus-agent/main.go index c574206e2..9e018f9ba 100644 --- a/cmd/incus-agent/main.go +++ b/cmd/incus-agent/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "runtime" @@ -48,6 +49,7 @@ func main() { // Run the main command and handle errors err := app.Execute() if err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } } diff --git a/cmd/incus-agent/main_agent.go b/cmd/incus-agent/main_agent.go index 8f189c925..e2f281776 100644 --- a/cmd/incus-agent/main_agent.go +++ b/cmd/incus-agent/main_agent.go @@ -47,8 +47,7 @@ func (c *cmdAgent) Command() *cobra.Command { func (c *cmdAgent) Run(cmd *cobra.Command, args []string) error { if c.global.flagService { - err := runService("Incus-Agent", c) - return err + return runService("Incus-Agent", c) } // Setup logger.