Commit 66a07773 authored by Toby Allen's avatar Toby Allen

Log Startup and Shutdown Commands

parent 2b9bbc52
package startupshutdown package startupshutdown
import ( import (
"log"
"os" "os"
"os/exec" "os/exec"
"strings" "strings"
...@@ -53,8 +54,10 @@ func registerCallback(c *caddy.Controller, registerFunc func(func() error)) erro ...@@ -53,8 +54,10 @@ func registerCallback(c *caddy.Controller, registerFunc func(func() error)) erro
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
if nonblock { if nonblock {
log.Printf("[INFO] Nonblocking Command:\"%s %s\"", command, strings.Join(args, " "))
return cmd.Start() return cmd.Start()
} }
log.Printf("[INFO] Blocking Command:\"%s %s\"", command, strings.Join(args, " "))
return cmd.Run() return cmd.Run()
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment