0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-20 22:52:58 -05:00

Log Startup and Shutdown Commands

This commit is contained in:
Toby Allen 2016-10-24 20:48:36 +01:00
parent 2b9bbc5236
commit 66a07773ab

View file

@ -1,6 +1,7 @@
package startupshutdown
import (
"log"
"os"
"os/exec"
"strings"
@ -53,8 +54,10 @@ func registerCallback(c *caddy.Controller, registerFunc func(func() error)) erro
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if nonblock {
log.Printf("[INFO] Nonblocking Command:\"%s %s\"", command, strings.Join(args, " "))
return cmd.Start()
}
log.Printf("[INFO] Blocking Command:\"%s %s\"", command, strings.Join(args, " "))
return cmd.Run()
}