From 63731e7ba5e4085d071092ff4c7d712a30e07f28 Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Tue, 11 Jun 2024 18:27:31 +0300 Subject: [PATCH] home: imp systemd script --- CHANGELOG.md | 4 ++++ internal/home/service.go | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa0f3512c6d..2e0b6e9ae8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,11 +30,15 @@ NOTE: Add new changes BELOW THIS COMMENT. ### Changed - Frontend rewritten in TypeScript. +- The `systemd`-based service now uses `journal` for logging by default. It + also doesn't create the `/var/log/` directory anymore ([#7053]). ### Deprecated - Node 18 support, Node 20 will be required in future releases. +[#7053]: https://github.com/AdguardTeam/AdGuardHome/issues/7053 + diff --git a/internal/home/service.go b/internal/home/service.go index 30bef2a7c14..1d87f162fc1 100644 --- a/internal/home/service.go +++ b/internal/home/service.go @@ -471,7 +471,6 @@ ConditionFileIsExecutable={{.Path|cmdEscape}} [Service] StartLimitInterval=5 StartLimitBurst=10 -ExecStartPre=/bin/mkdir -p /var/log/ ExecStart={{.Path|cmdEscape}}{{range .Arguments}} {{.|cmd}}{{end}} {{if .ChRoot}}RootDirectory={{.ChRoot|cmd}}{{end}} {{if .WorkingDirectory}}WorkingDirectory={{.WorkingDirectory|cmdEscape}}{{end}} @@ -479,8 +478,8 @@ ExecStart={{.Path|cmdEscape}}{{range .Arguments}} {{.|cmd}}{{end}} {{if .ReloadSignal}}ExecReload=/bin/kill -{{.ReloadSignal}} "$MAINPID"{{end}} {{if .PIDFile}}PIDFile={{.PIDFile|cmd}}{{end}} {{if and .LogOutput .HasOutputFileSupport -}} -StandardOutput=file:/var/log/{{.Name}}.out -StandardError=file:/var/log/{{.Name}}.err +StandardOutput=journal +StandardError=journal {{- end}} {{if gt .LimitNOFILE -1 }}LimitNOFILE={{.LimitNOFILE}}{{end}} {{if .Restart}}Restart={{.Restart}}{{end}}