mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Merge pull request #1211 from mholt/LogStartupCmd
Log Startup and Shutdown Commands
This commit is contained in:
commit
561069fdb6
1 changed files with 3 additions and 0 deletions
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue