]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
systemd: drop RefuseManualStart=true, disable kresd.service by default
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 19 Oct 2017 19:32:20 +0000 (15:32 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 19 Oct 2017 21:00:13 +0000 (17:00 -0400)
I introduced RefuseManualStart=true last year when writing the initial
systemd unit file for kresd.  I did this because i didn't want to
start running the daemon if no one was going to talk to it.

I'm no longer convinced that this directive has a good justification.
While i think that there is no need to activate the service without
socket activation, i think preventing manual invocation is actively
harmful (admins will reflexively do "systemctl restart kresd" just
like they do "systemctl restart apache2" and it's jarring to have it
rejected).

A distributor who wants to (by default) delay kresd startup until it
is accessed can ship the preset file included here, but leave the
*.socket units enabled by default.

systemd/90-kresd.preset [new file with mode: 0644]
systemd/README.md
systemd/kresd.service

diff --git a/systemd/90-kresd.preset b/systemd/90-kresd.preset
new file mode 100644 (file)
index 0000000..ee99340
--- /dev/null
@@ -0,0 +1,6 @@
+# kresd is fully socket-activated, so it does not need to be enabled
+# in the systemd sense (automatically started at boot).  The
+# associated sockets *are* enabled however, so the kresd service will
+# be started as soon as anything connects to one of the listening
+# sockets.
+disable kresd.service
index 8ddbdc17d41fb38ca88383f75c006ac5768bd740..daa414da28ba5fc04b17a13b40c6b6d8e1504cd2 100644 (file)
@@ -6,6 +6,11 @@ by systemd (or any supervisor that provides equivalent file descriptor
 initialization via the interface supported by
 sd_listen_fds_with_names(3)).
 
+Distributors of systems using systemd may wish to place
+./90-kresd.preset in /lib/systemd/systemd-preset/90-kresd.preset if
+they want to delay daemon launch until it is accessed. (see
+systemd.preset(5)).
+
 When run in this configuration:
 
  * it will be run under a non-privileged user, which means it will not
index 186126d00599307c359ce653661dba6cb9221c28..2022401368b7af169943d3995ef47ca86d673486 100644 (file)
@@ -1,8 +1,6 @@
 [Unit]
 Description=Knot DNS Resolver daemon
 Documentation=man:kresd(8)
-## This is a socket-activated service:
-RefuseManualStart=true
 
 [Service]
 Type=notify