Fix log rotation error due to missing templates dir in compiled build

This commit is contained in:
Dane Everitt 2020-09-17 20:16:27 -07:00
parent 6ba1b75696
commit 815539b3da
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 15 additions and 14 deletions

View File

@ -135,7 +135,21 @@ func (sc *SystemConfiguration) EnableLogRotation() error {
}
defer f.Close()
t, err := template.ParseFiles("templates/logrotate.tpl")
t, err := template.New("logrotate").Parse(`
{{.LogDirectory}}/wings.log {
size 10M
compress
delaycompress
dateext
maxage 7
missingok
notifempty
create 0640 {{.User.Uid}} {{.User.Gid}}
postrotate
killall -SIGHUP wings
endscript
}`)
if err != nil {
return errors.WithStack(err)
}

View File

@ -1,13 +0,0 @@
{{.LogDirectory}}/wings.log {
size 10M
compress
delaycompress
dateext
maxage 7
missingok
notifempty
create 0640 {{.User.Uid}} {{.User.Gid}}
postrotate
killall -SIGHUP wings
endscript
}