From: Fred Morcos Date: Fri, 4 Aug 2023 11:22:23 +0000 (+0200) Subject: Meson: Systemd and its service file handling X-Git-Tag: rec-5.1.0-alpha1~80^2~300 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6feb87b26617a3dfb08d2c001f4327207e3b1ab5;p=thirdparty%2Fpdns.git Meson: Systemd and its service file handling --- diff --git a/meson.build b/meson.build index 1bc24c214a..a2a307b582 100644 --- a/meson.build +++ b/meson.build @@ -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 index 0000000000..6aadb39738 --- /dev/null +++ b/meson/systemd/meson.build @@ -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 diff --git a/meson_options.txt b/meson_options.txt index 9d1a05d0ed..2a6f6728c0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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')