From: Aleš Mrázek Date: Thu, 21 May 2026 12:30:02 +0000 (+0200) Subject: systemd: remove legacy units/services X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ebf66d546b86cb0102bbd54eeb89cc8649e7506b;p=thirdparty%2Fknot-resolver.git systemd: remove legacy units/services --- diff --git a/doc/kresctl.8.in b/doc/kresctl.8.in index d8770ca07..9993ab57b 100644 --- a/doc/kresctl.8.in +++ b/doc/kresctl.8.in @@ -61,7 +61,7 @@ Equivalent to PUT method in the underlying HTTP API. .B stop Gracefully stops the running resolver. .SH "SEE ALSO" -\fBkresd(8)\fR, @man_seealso_systemd@\fIhttps://www.knot-resolver.cz/documentation/latest/\fR +\fBkresd(8)\fR, \fIhttps://www.knot-resolver.cz/documentation/latest/\fR .SH "AUTHORS" .B kresd developers are mentioned in the AUTHORS file in the distribution. diff --git a/doc/kresd.8.in b/doc/kresd.8.in index c1c2a88c5..2463b6b5f 100644 --- a/doc/kresd.8.in +++ b/doc/kresd.8.in @@ -108,7 +108,7 @@ Show short command-line option help. .B \-V Show the version. .SH "SEE ALSO" -@man_seealso_systemd@\fIhttps://www.knot-resolver.cz/documentation/latest/\fR +\fIhttps://www.knot-resolver.cz/documentation/latest/\fR .SH "AUTHORS" .B kresd developers are mentioned in the AUTHORS file in the distribution. diff --git a/doc/meson.build b/doc/meson.build index 1adfaa041..697d9e6fd 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -6,11 +6,6 @@ man_config = configuration_data() man_config.set('version', meson.project_version()) man_config.set('date', run_command('../scripts/lib/get-date.sh', check: true).stdout()) -man_config.set('man_seealso_systemd', '') -if systemd_legacy_units == 'enabled' - man_config.set('man_seealso_systemd', '\\fIkresd.systemd(7)\\fR, ') -endif - man_kresd = configure_file( input: 'kresd.8.in', output: 'kresd.8', diff --git a/meson.build b/meson.build index a12cfce54..bacbb57ca 100644 --- a/meson.build +++ b/meson.build @@ -212,7 +212,6 @@ summary({'sendmmsg': sendmmsg, ### Systemd; most is in systemd/meson.build systemd_files = get_option('systemd_files') -systemd_legacy_units = get_option('systemd_legacy_units') libsystemd = dependency('libsystemd', required: systemd_files == 'enabled') summary({'libsystemd support': libsystemd.found(), 'files': systemd_files == 'enabled', diff --git a/meson_options.txt b/meson_options.txt index 67543aa1d..f45b85d57 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -101,17 +101,6 @@ option( description: 'installs systemd-related files', ) -option( - 'systemd_legacy_units', - type: 'combo', - choices: [ - 'disabled', - 'enabled', - ], - value: 'disabled', - description: 'installs legacy systemd units for running without manager, like with versions before 6', -) - # Component options option( 'bench', diff --git a/systemd/kres-cache-gc.service.in b/systemd/kres-cache-gc.service.in deleted file mode 100644 index 6e39fcc6f..000000000 --- a/systemd/kres-cache-gc.service.in +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-License-Identifier: CC0-1.0 -[Unit] -Description=Knot Resolver Garbage Collector daemon -Documentation=man:kresd.systemd(7) -Documentation=man:kresd(8) - -[Service] -Type=simple -ExecStart=@sbin_dir@/kres-cache-gc -c @systemd_cache_dir@ -d 1000 -User=@user@ -Group=@group@ -Restart=on-failure -RestartSec=30 -StartLimitInterval=400 -StartLimitBurst=10 -Slice=system-kresd.slice - -[Install] -WantedBy=kresd.target diff --git a/systemd/kresd.systemd.7.in b/systemd/kresd.systemd.7.in deleted file mode 100644 index cb0a65feb..000000000 --- a/systemd/kresd.systemd.7.in +++ /dev/null @@ -1,100 +0,0 @@ -.TH "kresd.systemd" "7" "@date@" "CZ.NIC" "Knot Resolver @version@ Systemd Units" -.\" -.\" kresd.systemd.7 -- man page for systemd units for kresd -.\" -.\" Copyright (c) CZ.NIC. All rights reserved. -.\" -.\" SPDX-License-Identifier: GPL-3.0-or-later -.\" -.\" -.SH "NAME" -kresd.systemd -\- managing Knot Resolver @version@ through systemd. - -.SH "SYNOPSIS" -.nf -kresd@.service -kresd.target -system-kresd.slice -.fi - -.SH "DESCRIPTION" -.P -This manual page describes how to manage \fBkresd\fR using \fBsystemd\fR -units. - -.B QUICKSTART - -.nf -.RS 4n -\fBsystemctl start kresd@1\fR - single instance of kresd, responding on localhost -.RE -.fi - -.B CONCURRENT DAEMONS - -\fBkresd\fR daemon can be executed in multiple independent processes, which are -managed with \fBsystemd\fR via systemd templates (see \fBsystemd.unit\fR(5)). -Each \fBsystemd\fR service instance of \fBkresd\fR (\fIkresd@.service\fR) -represents a single, independent kresd process. - -If you have more than one CPU core available, a single running \fBkresd\fR -daemon will only be able to make use of one core at a time, leaving the other -cores idle. If you want \fBkresd\fR to take advantage of all available cores, -while sharing both cache and sockets, you should enable and start as many -instances of the \fBkresd@.service\fR as you have cores. Typically, each -instance is just named \fIkresd@\fBN\fI.service\fR, where \fIN\fR is a decimal -number. For example, to enable and start 3 concurrent daemons: - -.nf -.RS 4n -.B systemctl enable --now kresd@1.service kresd@2.service kresd@3.service -.RE -.fi - -The systemd-managed \fBkresd\fR service set is grouped in the -\fIsystem-kresd.slice\fR slice. The slice includes all running daemons -(instances of \fIkresd@.service\fR). - -.SH "EXAMPLES" - -To start a single kresd instance and enable it at boot: -.nf -.RS 4n -.B systemctl enable --now kresd@1.service -.RE -.fi - -To restart (or stop) all running instances, you can use a glob expression. -Please note that glob can't be used to start or enable instances. -.nf -.RS 4n -.B systemctl restart 'kresd@*' -.RE -.fi - -Bash users can also use Brace Expansion to enable or start multiple instances, -instead of listing them manually. -.nf -.RS 4n -.B systemctl enable --now kresd@{1..4}.service -.RE -.fi - -To start all enabled kresd daemons, you can also use the provided \fIkresd.target\fR: -.nf -.RS 4n -.B systemctl start kresd.target -.RE -.fi - -.RE - -.SH "SEE ALSO" -\fIkresd(8)\fR, -\fIsystemd.unit(5)\fR, -\fIhttps://www.knot-resolver.cz/documentation/latest/\fR - -.SH "AUTHORS" -.B kresd -developers are mentioned in the AUTHORS file in the distribution. diff --git a/systemd/kresd.target b/systemd/kresd.target deleted file mode 100644 index 5a2d78687..000000000 --- a/systemd/kresd.target +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: CC0-1.0 -[Unit] -Description=Knot Resolver daemons -Documentation=man:kresd.systemd(7) -Documentation=man:kresd(8) -After=network-online.target - -[Install] -WantedBy=multi-user.target diff --git a/systemd/kresd@.service.in b/systemd/kresd@.service.in deleted file mode 100644 index adb303adb..000000000 --- a/systemd/kresd@.service.in +++ /dev/null @@ -1,30 +0,0 @@ -# SPDX-License-Identifier: CC0-1.0 -[Unit] -Description=Knot Resolver daemon -Documentation=man:kresd.systemd(7) -Documentation=man:kresd(8) -Wants=kres-cache-gc.service -Before=kres-cache-gc.service -Wants=network-online.target -After=network-online.target -Before=nss-lookup.target -Wants=nss-lookup.target - -[Service] -Type=notify -Environment="SYSTEMD_INSTANCE=%i" -WorkingDirectory=@systemd_work_dir@ -ExecStart=@sbin_dir@/kresd -c @lib_dir@/distro-preconfig.lua -c @etc_dir@/kresd.conf -n -ExecStopPost=/usr/bin/env rm -f "@run_dir@/control/%i" -User=@user@ -Group=@group@ -CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETPCAP -AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_SETPCAP -TimeoutStopSec=10s -WatchdogSec=10s -Restart=on-abnormal -LimitNOFILE=524288 -Slice=system-kresd.slice - -[Install] -WantedBy=kresd.target diff --git a/systemd/meson.build b/systemd/meson.build index e9a1c7a97..da75a189c 100644 --- a/systemd/meson.build +++ b/systemd/meson.build @@ -13,36 +13,6 @@ systemd_config.set('etc_dir', etc_dir) systemd_config.set('run_dir', run_dir) systemd_config.set('lib_dir', lib_dir) -if systemd_legacy_units == 'enabled' - - ## unit files - kresd_service = configure_file( - input: 'kresd@.service.in', - output: 'kresd@.service', - configuration: systemd_config, - install_dir: systemd_unit_dir, - ) - kres_cache_gc_service = configure_file( - input: 'kres-cache-gc.service.in', - output: 'kres-cache-gc.service', - configuration: systemd_config, - install_dir: systemd_unit_dir, - ) - install_data( - sources: 'kresd.target', - install_dir: systemd_unit_dir, - ) - ## man page - kresd_systemd_man = configure_file( - input: 'kresd.systemd.7.in', - output: 'kresd.systemd.7', - configuration: man_config, - ) - install_man(kresd_systemd_man) - -endif - - if systemd_files == 'enabled' manager_service = configure_file(