]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Systemd and its service file handling
authorFred Morcos <fred.morcos@open-xchange.com>
Fri, 4 Aug 2023 11:22:23 +0000 (13:22 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:32 +0000 (13:28 +0100)
meson.build
meson/systemd/meson.build [new file with mode: 0644]
meson_options.txt

index 1bc24c214a645bf35ec188ac42158bac685a9ba8..a2a307b582c6116bd502e102d8c864b899c5208f 100644 (file)
@@ -65,6 +65,7 @@ subdir('meson/pkcs11')                   # PKCS11
 subdir('meson/gss-tsig')                 # GSS-TSIG
 subdir('meson/auth-tools')               # Tools
 subdir('meson/ixfrdist')                 # Ixfrdist
+subdir('meson/systemd')                  # Systemd and unit file handling
 
 # Find or generate pdns/dnslabeltext.cc
 if not ragel.found() and not fs.exists('pdns/dnslabeltext.cc')
diff --git a/meson/systemd/meson.build b/meson/systemd/meson.build
new file mode 100644 (file)
index 0000000..6aadb39
--- /dev/null
@@ -0,0 +1,17 @@
+# Systemd and unit file handling
+# Inputs: conf
+# Outputs: dep_systemd
+
+dep_systemd = dependency('systemd', required: false)
+conf.set10('HAVE_SYSTEMD', dep_systemd.found(), description: 'Whether we have systemd')
+summary('Systemd', dep_systemd.found(), bool_yn: true, section: 'Configuration')
+
+if dep_systemd.found()
+  summary('Systemd Version', dep_systemd.version(), section: 'Configuration')
+
+  systemd_service_user = get_option('systemd-service-user')
+  systemd_service_group = get_option('systemd-service-group')
+
+  summary('Systemd User', systemd_service_user, section: 'Configuration')
+  summary('Systemd Group', systemd_service_group, section: 'Configuration')
+endif
index 9d1a05d0ed10cbb9cee2680c94b031b660eb53e5..2a6f6728c052c6bf982b729e5c8bdee674ad66c7 100644 (file)
@@ -44,3 +44,5 @@ option('module-lua2-dyn', type: 'boolean', value: false, description: 'Build the
 option('tools', type: 'boolean', value: false, description: 'Build the extra tools')
 option('ixfrdist', type: 'boolean', value: false, description: 'Build ixfrdist')
 option('lua-records', type: 'boolean', value: true, description: 'Build support for Lua records')
+option('systemd-service-user', type: 'string', value: 'pdns', description: 'User to run the systemd pdns service as. Only the setuid setting and User field in the systemd unit file are affected, the user is not created')
+option('systemd-service-group', type: 'string', value: 'pdns', description: 'Group to run the systemd pdns service under. Only the setgid setting and Group field in the systemd unit file are affected, the group is not created')