0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-03-25 02:33:02 -05:00

caddy: allow reload under service

This commit is contained in:
Daniel Theophanes 2016-02-08 14:04:32 -08:00
parent 1de6f3b4b9
commit 3afb86fdf0

13
main.go
View file

@ -56,6 +56,8 @@ func init() {
func main() {
flag.Parse() // called here in main() to allow other packages to set flags in their inits
const svcPIDFile = `/run/Caddy.pid`
caddy.AppName = appName
caddy.AppVersion = appVersion
acme.UserAgent = appName + "/" + appVersion
@ -106,7 +108,13 @@ func main() {
Name: caddy.AppName,
DisplayName: caddy.AppName,
Arguments: []string{"-conf", serviceCaddyPath},
Arguments: []string{"-conf", serviceCaddyPath, "-pidfile", svcPIDFile},
Option: service.KeyValue{
"RunWait": caddy.Wait,
"ReloadSignal": "USR1",
"PIDFile": svcPIDFile,
},
})
if err != nil {
mustLogFatal(err)
@ -125,9 +133,6 @@ func main() {
if err != nil {
mustLogFatal(err)
}
// Twiddle your thumbs
caddy.Wait()
}
type app struct{}