]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Drop CAP_KILL, use + prefix for ExecReload= instead 87/head
authorPascal Ernster <github@hardfalcon.net>
Thu, 26 Sep 2019 08:41:37 +0000 (08:41 +0000)
committerGitHub <noreply@github.com>
Thu, 26 Sep 2019 08:41:37 +0000 (08:41 +0000)
CAP_KILL seems a bit too much privileges for the sole purpose of being able to make ExecReload= work.
Use the + prefix on ExecReload= instead to run "/bin/kill -HUP $MAINPID" with full privileges, ignoring the restrictions from CapabilityBoundingSet=.

See https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart= for further details about the + prefix in ExecReload=.

contrib/unbound.service.in

index 334ab6d17e29b1545ef675f437bd0be8c59a6a91..6eb2d0c3fe40af61302bd072e49d25cb538fbde3 100644 (file)
@@ -9,11 +9,11 @@ Wants=nss-lookup.target
 WantedBy=multi-user.target
 
 [Service]
-ExecReload=/bin/kill -HUP $MAINPID
+ExecReload=+/bin/kill -HUP $MAINPID
 ExecStart=@UNBOUND_SBIN_DIR@/unbound -d
 NotifyAccess=main
 Type=notify
-CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_SYS_RESOURCE CAP_NET_RAW CAP_KILL
+CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_SYS_RESOURCE CAP_NET_RAW
 MemoryDenyWriteExecute=true
 NoNewPrivileges=true
 PrivateDevices=true