From 2635762b071c887a11a3c00e4aaa7ab96076ef65 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 30 Mar 2023 14:25:43 +0200 Subject: [PATCH] systemd/knot-resolver.service.in: generalize paths I can't see why not. Also avoid unnecessary /usr/bin/env kresd doesn't work well without `ninja install` anyway. bindir: maybe we should install the python binaries into sbin instead. We're also being slightly inconsistent - allowing to override some directories by meson but not respecting it for the python stuff. --- meson.build | 1 + systemd/knot-resolver.service.in | 6 +++--- systemd/meson.build | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 810933d29..3ae4a69ae 100644 --- a/meson.build +++ b/meson.build @@ -53,6 +53,7 @@ etc_dir = prefix / get_option('sysconfdir') / 'knot-resolver' lib_dir = prefix / get_option('libdir') / 'knot-resolver' modules_dir = lib_dir / 'kres_modules' sbin_dir = prefix / get_option('sbindir') +bin_dir = prefix / get_option('bindir') run_dir = '/run' / 'knot-resolver' systemd_work_dir = prefix / get_option('localstatedir') / 'lib' / 'knot-resolver' systemd_cache_dir = prefix / get_option('localstatedir') / 'cache' / 'knot-resolver' diff --git a/systemd/knot-resolver.service.in b/systemd/knot-resolver.service.in index 84efbfc55..a68867005 100644 --- a/systemd/knot-resolver.service.in +++ b/systemd/knot-resolver.service.in @@ -9,14 +9,14 @@ Wants=nss-lookup.target [Service] Type=notify TimeoutStartSec=10s -ExecStart=/usr/bin/env knot-resolver --config=/etc/knot-resolver/config.yml +ExecStart=@bin_dir@/knot-resolver --config=@etc_dir@/config.yml +ExecReload=@bin_dir@/kresctl --socket @run_dir@/manager.sock reload KillSignal=SIGINT -WorkingDirectory=/var/run/knot-resolver/ +WorkingDirectory=@systemd_work_dir@ User=@user@ Group=@group@ CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETPCAP AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_SETPCAP -ExecReload=/usr/bin/env kresctl --socket /var/run/knot-resolver/manager.sock reload [Install] WantedBy=multi-user.target \ No newline at end of file diff --git a/systemd/meson.build b/systemd/meson.build index 17bad8288..0948e69f5 100644 --- a/systemd/meson.build +++ b/systemd/meson.build @@ -8,6 +8,7 @@ systemd_config.set('group', group) systemd_config.set('systemd_work_dir', systemd_work_dir) systemd_config.set('systemd_cache_dir', systemd_cache_dir) systemd_config.set('sbin_dir', sbin_dir) +systemd_config.set('bin_dir', bin_dir) systemd_config.set('etc_dir', etc_dir) systemd_config.set('run_dir', run_dir) systemd_config.set('lib_dir', lib_dir) -- 2.47.3