From: Aleš Mrázek Date: Thu, 21 May 2026 14:19:14 +0000 (+0200) Subject: systemd: use {Runtime,State,Cache}Directory X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fsystemd-remove-tmpfiles;p=thirdparty%2Fknot-resolver.git systemd: use {Runtime,State,Cache}Directory Minimum systemd version set to 247. --- diff --git a/meson.build b/meson.build old mode 100644 new mode 100755 index c45534127..0212ce58b --- a/meson.build +++ b/meson.build @@ -211,7 +211,7 @@ summary({'sendmmsg': sendmmsg, ### Systemd; most is in systemd/meson.build systemd_files = get_option('systemd_files') -libsystemd = dependency('libsystemd', required: systemd_files == 'enabled') +libsystemd = dependency('libsystemd', version: '>=235', required: systemd_files == 'enabled') summary({'libsystemd support': libsystemd.found(), 'files': systemd_files == 'enabled', }, section: 'Systemd', bool_yn: true) diff --git a/systemd/knot-resolver.service.in b/systemd/knot-resolver.service.in index 23a7255b8..ed93c6055 100644 --- a/systemd/knot-resolver.service.in +++ b/systemd/knot-resolver.service.in @@ -1,5 +1,5 @@ [Unit] -Description=Knot Resolver Manager +Description=Knot Resolver Documentation=man:knot-resolver.systemd(7) Wants=network-online.target After=network-online.target @@ -14,6 +14,12 @@ Environment=KRES_LOGGING_TARGET=syslog ExecReload=@bin_dir@/kresctl --config=@etc_dir@/config.yaml reload KillSignal=SIGINT WorkingDirectory=@systemd_work_dir@ +StateDirectory=knot-resolver +StateDirectoryMode=0750 +RuntimeDirectory=knot-resolver +RuntimeDirectoryMode=0750 +CacheDirectory=knot-resolver +CacheDirectoryMode=0750 User=@user@ Group=@group@ CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETPCAP diff --git a/systemd/meson.build b/systemd/meson.build index f3bf10af2..be92da58d 100644 --- a/systemd/meson.build +++ b/systemd/meson.build @@ -15,7 +15,7 @@ systemd_config.set('lib_dir', lib_dir) if systemd_files == 'enabled' - manager_service = configure_file( + systemd_service = configure_file( input: 'knot-resolver.service.in', output: 'knot-resolver.service', configuration: systemd_config, @@ -23,13 +23,13 @@ if systemd_files == 'enabled' ) ## sysusers - sysusers = configure_file( + systemd_sysusers = configure_file( input: 'sysusers.d/knot-resolver.conf.in', output: 'knot-resolver.sysusers', configuration: systemd_config, ) install_data( - sysusers, + systemd_sysusers, rename: ['knot-resolver.conf'], install_dir: systemd_sysusers_dir, )