-
Notifications
You must be signed in to change notification settings - Fork 883
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14055 from fredmorcos/meson-systemd-services
Meson: `pdns-auth` and `ixfrdist` systemd service files
- Loading branch information
Showing
6 changed files
with
279 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[Unit] | ||
Description=@Description@ | ||
Documentation=man:ixfrdist(1) | ||
Documentation=man:ixfrdist.yml(5) | ||
Documentation=https://doc.powerdns.com | ||
Wants=network-online.target | ||
After=network-online.target time-sync.target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=@BinDir@/ixfrdist @Config@ | ||
Restart=on-failure | ||
RestartSec=1 | ||
StartLimitInterval=0 | ||
|
||
# Sandboxing | ||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID | ||
NoNewPrivileges=true | ||
DevicePolicy=closed | ||
@LockPersonality@ | ||
@PrivateDevices@ | ||
@PrivateTmp@ | ||
@PrivateUsers@ | ||
@ProtectClock@ | ||
@ProtectControlGroups@ | ||
@ProtectHome@ | ||
@ProtectHostname@ | ||
@ProtectKernelLogs@ | ||
@ProtectKernelModules@ | ||
@ProtectKernelTunables@ | ||
@ProtectSystem@ | ||
@RestrictAddressFamilies@ | ||
@RestrictNamespaces@ | ||
@RestrictRealtime@ | ||
@RestrictSUIDSGID@ | ||
@SystemCallArchitectures@ | ||
@SystemCallFilter@ | ||
@ProtectProc@ | ||
@PrivateIPC@ | ||
@RemoveIPC@ | ||
@MemoryDenyWriteExecute@ | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[Unit] | ||
Description=@Description@ | ||
Documentation=man:pdns-auth(1) | ||
Documentation=man:pdns-auth-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 | ||
|
||
[Service] | ||
ExecStart=@StaticBinDir@/pdns-auth @ConfigName@ @SocketDir@ --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no | ||
SyslogIdentifier=@SyslogIdentifier@ | ||
User=@ServiceUser@ | ||
Group=@ServiceGroup@ | ||
Type=notify | ||
Restart=on-failure | ||
RestartSec=1 | ||
StartLimitInterval=0 | ||
RuntimeDirectory=@RuntimeDirectory@ | ||
|
||
# Sandboxing | ||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_CHOWN | ||
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_CHOWN | ||
NoNewPrivileges=true | ||
DevicePolicy=closed | ||
@LockPersonality@ | ||
@PrivateDevices@ | ||
@PrivateTmp@ | ||
@PrivateUsers@ | ||
@ProtectClock@ | ||
@ProtectControlGroups@ | ||
@ProtectHome@ | ||
@ProtectHostname@ | ||
@ProtectKernelLogs@ | ||
@ProtectKernelModules@ | ||
@ProtectKernelTunables@ | ||
@ProtectSystem@ | ||
@RestrictAddressFamilies@ | ||
@RestrictNamespaces@ | ||
@RestrictRealtime@ | ||
@RestrictSUIDSGID@ | ||
@SystemCallArchitectures@ | ||
@SystemCallFilter@ | ||
@ProtectProc@ | ||
@PrivateIPC@ | ||
@RemoveIPC@ | ||
@MemoryDenyWriteExecute@ | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
opt_systemd = get_option('systemd') | ||
|
||
dep_systemd = dependency('libsystemd', required: opt_systemd) | ||
conf.set('HAVE_SYSTEMD', dep_systemd.found(), description: 'libsystemd') | ||
summary('libsystemd', dep_systemd.found(), bool_yn: true, section: 'Configuration') | ||
|
||
if dep_systemd.found() | ||
summary('Lib Version', dep_systemd.version(), section: 'Systemd') | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,50 @@ | ||
dep_systemd = dependency('libsystemd', required: false) | ||
conf.set('HAVE_SYSTEMD', dep_systemd.found(), description: 'systemd') | ||
summary('Systemd', dep_systemd.found(), bool_yn: true, section: 'Configuration') | ||
dep_systemd_prog = dependency('systemd', required: false) | ||
summary('Systemd', dep_systemd_prog.found(), bool_yn: true, section: 'Configuration') | ||
|
||
if dep_systemd.found() | ||
summary('Version', dep_systemd.version(), section: 'Systemd') | ||
# Map systemd features to systemd/systemctl version. | ||
systemd_features = { | ||
'private_tmp': 183, | ||
'system_call_architectures': 209, | ||
'private_devices': 209, | ||
'restrict_address_families': 211, | ||
'protect_system': 214, | ||
'protect_home': 214, | ||
'restrict_realtime': 231, | ||
'memory_deny_write_execute': 231, | ||
'protect_control_groups': 232, | ||
'protect_kernel_modules': 232, | ||
'protect_kernel_tunables': 232, | ||
'remove_ipc': 232, | ||
'dynamic_user': 232, | ||
'private_users': 232, | ||
'protect_system_strict': 232, | ||
'restrict_namespaces': 233, | ||
'lock_personality': 235, | ||
# while SystemCallFilter is technically available starting with 187, | ||
# we use the pre-defined call filter sets that have been introduced later. | ||
# Initial support for these landed in 231 | ||
# @filesystem @reboot @swap in 233 | ||
# @aio, @sync, @chown, @setuid, @memlock, @signal and @timer in 235 | ||
'system_call_filter': 235, | ||
'percent_t': 236, | ||
'private_mounts': 239, | ||
'with_runtime_dir_env': 240, | ||
'protect_hostname': 242, | ||
'restrict_suidsgid': 242, | ||
'protect_kernel_logs': 244, | ||
'protect_clock': 245, | ||
'protect_proc': 247, | ||
'private_ipc': 248, | ||
} | ||
|
||
systemd_service_user = get_option('systemd-service-user') | ||
systemd_service_group = get_option('systemd-service-group') | ||
systemd_version = dep_systemd_prog.version() | ||
foreach feature, version: systemd_features | ||
feature_name = 'have_systemd_' + feature | ||
feature_value = systemd_version.version_compare('>=' + version.to_string()) | ||
set_variable(feature_name, feature_value) | ||
conf.set(feature_name.to_upper(), feature_value, description: 'systemd feature: ' + feature) | ||
endforeach | ||
|
||
summary('Service User', systemd_service_user, section: 'Systemd') | ||
summary('Service Group', systemd_service_group, section: 'Systemd') | ||
if dep_systemd_prog.found() | ||
summary('Version', dep_systemd_prog.version(), section: 'Systemd') | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters