]
if dep_systemd_prog.found()
+ systemd_system_unit_dir = dep_systemd_prog.get_variable(
+ 'systemdsystemunitdir',
+ )
systemd_service_conf = configuration_data()
systemd_service_conf.set('BinDir', get_option('prefix') / get_option('bindir'))
systemd_service_conf.set('StaticBinDir', get_option('prefix') / get_option('sbindir'))
auth_service_conf_general.set('Description', 'PowerDNS Authoritative Server')
auth_service_conf_general.set('ConfigName', '')
auth_service_conf_general.set('SocketDir', enable_socket_dir ? '--socket-dir=%t/pdns' : '')
- auth_service_conf_general.set('SyslogIdentifier', 'pdns')
+ auth_service_conf_general.set('SyslogIdentifier', 'pdns_server')
auth_service_conf_general.set('RuntimeDirectory', 'pdns')
configure_file(
- input: 'auth' / 'systemd' / 'pdns.service.in',
+ input: 'pdns' / 'pdns.service.meson.in',
output: 'pdns.service',
configuration: auth_service_conf_general,
+ install: true,
+ install_dir: systemd_system_unit_dir,
)
auth_service_conf_instance = configuration_data()
auth_service_conf_instance.set('RuntimeDirectory', have_systemd_percent_t ? 'pdns-%i' : 'pdns')
configure_file(
- input: 'auth' / 'systemd' / 'pdns.service.in',
+ input: 'pdns' / 'pdns.service.meson.in',
output: 'pdns@.service',
configuration: auth_service_conf_instance,
+ install: true,
+ install_dir: systemd_system_unit_dir,
)
if get_option('tools-ixfrdist')
ixfrdist_service_conf_general.set('Config', '')
configure_file(
- input: 'auth' / 'systemd' / 'ixfrdist.service.in',
+ input: 'pdns' / 'ixfrdist.service.meson.in',
output: 'ixfrdist.service',
configuration: ixfrdist_service_conf_general,
+ install: true,
+ install_dir: systemd_system_unit_dir,
)
ixfrdist_service_conf_instance = configuration_data()
ixfrdist_service_conf_instance.set('Config', '--config=' + get_option('sysconfdir') + '/ixfrdist-%i.yml')
configure_file(
- input: 'auth' / 'systemd' / 'ixfrdist.service.in',
+ input: 'pdns' / 'ixfrdist.service.meson.in',
output: 'ixfrdist@.service',
configuration: ixfrdist_service_conf_instance,
+ install: true,
+ install_dir: systemd_system_unit_dir,
)
endif
endif
[Unit]
Description=@Description@
-Documentation=man:pdns_server(1)
-Documentation=man:pdns_control(1)
+Documentation=man:pdns_server(1) man:pdns_control(1)
Documentation=https://doc.powerdns.com
Wants=network-online.target
After=network-online.target mysql.service mysqld.service postgresql.service slapd.service mariadb.service time-sync.target
# Sandboxing
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_CHOWN
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_CHOWN
-NoNewPrivileges=true
-DevicePolicy=closed
@LockPersonality@
+NoNewPrivileges=true
@PrivateDevices@
@PrivateTmp@
-@PrivateUsers@
+# Setting PrivateUsers=true prevents us from opening our sockets
@ProtectClock@
@ProtectControlGroups@
@ProtectHome@
@ProtectKernelLogs@
@ProtectKernelModules@
@ProtectKernelTunables@
+# ProtectSystem=full will disallow write access to /etc and /usr, possibly
+# not being able to write slaved-zones into sqlite3 or zonefiles.
@ProtectSystem@
@RestrictAddressFamilies@
@RestrictNamespaces@
@ProtectProc@
@PrivateIPC@
@RemoveIPC@
-@MemoryDenyWriteExecute@
+DevicePolicy=closed
+# Not enabled by default because it does not play well with LuaJIT
+# MemoryDenyWriteExecute=true
[Install]
WantedBy=multi-user.target