mirror of
https://github.com/NLnetLabs/unbound.git
synced 2024-09-21 14:47:09 +00:00
acdd4058d2
This is needed when unbound config doesn't set "do-daemonize: no" by itself otherwise starting service fails with: systemd[1]: unbound.service: Got notification message from PID <PID>, but reception only permitted for main PID which is currently not known https://github.com/NLnetLabs/unbound/blob/release-1.9.3/doc/example.conf.in#L236
39 lines
1.3 KiB
SYSTEMD
39 lines
1.3 KiB
SYSTEMD
[Unit]
|
|
Description=Validating, recursive, and caching DNS resolver
|
|
Documentation=man:unbound(8)
|
|
After=network.target
|
|
Before=network-online.target nss-lookup.target
|
|
Wants=nss-lookup.target
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|
|
[Service]
|
|
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
|
|
MemoryDenyWriteExecute=true
|
|
NoNewPrivileges=true
|
|
PrivateDevices=true
|
|
PrivateTmp=true
|
|
ProtectHome=true
|
|
ProtectControlGroups=true
|
|
ProtectKernelModules=true
|
|
ProtectSystem=strict
|
|
ReadWritePaths=/run @UNBOUND_RUN_DIR@ @UNBOUND_CHROOT_DIR@
|
|
TemporaryFileSystem=@UNBOUND_CHROOT_DIR@/dev:ro
|
|
TemporaryFileSystem=@UNBOUND_CHROOT_DIR@/run:ro
|
|
BindReadOnlyPaths=-/run/systemd/notify:@UNBOUND_CHROOT_DIR@/run/systemd/notify
|
|
BindPaths=-@UNBOUND_PIDFILE@:@UNBOUND_CHROOT_DIR@@UNBOUND_PIDFILE@
|
|
BindReadOnlyPaths=-/dev/urandom:@UNBOUND_CHROOT_DIR@/dev/urandom
|
|
BindPaths=-/dev/log:@UNBOUND_CHROOT_DIR@/dev/log
|
|
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
|
|
RestrictRealtime=true
|
|
SystemCallArchitectures=native
|
|
SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module mount @obsolete @resources
|
|
RestrictNamespaces=yes
|
|
LockPersonality=yes
|
|
RestrictSUIDSGID=yes
|