diff --git a/config/config_system.go b/config/config_system.go index 60c6727..ff19863 100644 --- a/config/config_system.go +++ b/config/config_system.go @@ -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) } diff --git a/templates/logrotate.tpl b/templates/logrotate.tpl deleted file mode 100644 index d848699..0000000 --- a/templates/logrotate.tpl +++ /dev/null @@ -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 -} \ No newline at end of file