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:
parent
1de6f3b4b9
commit
3afb86fdf0
1 changed files with 9 additions and 4 deletions
13
main.go
13
main.go
|
@ -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{}
|
||||
|
|
Loading…
Add table
Reference in a new issue