dnsdist: Add support for systemd-notify #3677
Conversation
f08bdf6
to
ec22bbb
Nice! Perhaps we could also fallback to 'simple' if systemd support is not available, like weakforced does since 1? |
After pondering this, I feel there is no reason to generate a service file at all if there are no systemd(-dev) libraries installed, as the program is not intended to be run inside of systemd. We can stick a Type=simple service file in the contrib dir and have some documentation about this. |
ec22bbb
to
b141d4d
sock = getenv("NOTIFY_SOCKET"); | ||
if(sock != NULL) // Are we indeed running inside of systemd? | ||
g_cmdLine.beSupervised=true; | ||
#endif |
Habbie
Apr 11, 2016
Member
This can be overridden from the commandline still, I presume?
This can be overridden from the commandline still, I presume?
pieterlexis
Apr 11, 2016
Author
Member
not if your actually running inside systemd. There is no other way (as daemonizing will break systemd's detection of a startup and not being supervised will spawn a console with a closed stdin, leading to program termination) to do this. We could just exit(1)
here and print a message asking the user to start with --supervised
not if your actually running inside systemd. There is no other way (as daemonizing will break systemd's detection of a startup and not being supervised will spawn a console with a closed stdin, leading to program termination) to do this. We could just exit(1)
here and print a message asking the user to start with --supervised
|
||
AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [ | ||
AC_CHECK_HEADER([systemd/sd-daemon.h], [ | ||
AC_CHECK_LIB([systemd-daemon], [sd_listen_fds], [libsystemddaemon="y"]) |
rgacogne
Apr 11, 2016
Member
This seems to fail on Arch because libsystemd-daemon.so has been merged into libsystemd.so a while ago (looks like it was in version 209).
This seems to fail on Arch because libsystemd-daemon.so has been merged into libsystemd.so a while ago (looks like it was in version 209).
pieterlexis
Apr 12, 2016
Author
Member
Even centos 7's pkg-config mentions it as 'deprecated'. Debian jessie has systemd 215, so I'll just change the systemd-daemon
to systemd
Even centos 7's pkg-config mentions it as 'deprecated'. Debian jessie has systemd 215, so I'll just change the systemd-daemon
to systemd
# systemd.m4 - Macros to check for and enable systemd -*- Autoconf -*- | ||
# | ||
# Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com> | ||
# |
Habbie
Apr 11, 2016
Member
Can we note the origin (including revision) of this file (or whatever we replace it with to fix @rgacogne's report)?
Can we note the origin (including revision) of this file (or whatever we replace it with to fix @rgacogne's report)?
Imported https://github.com/mcgrof/funk-systemd/blob/b17396e7b1f5e93db74cae0e9123f39cf27a8339/src/m4/systemd.m4 as m4/systemd.m4 Imported https://github.com/mcgrof/funk-systemd/blob/b17396e7b1f5e93db74cae0e9123f39cf27a8339/src/m4/features.m4 as m4/ax_arg_default_enable_disable.m4
e26d287
to
0cd2a77
This patch is twofold: 1 - It detects the correct library for sd-daemon (either libsystemd-daemon (systemd pre-209) or libsystemd (systemd post-209) 2 - Detection of the library and files is only run once, even when systemd support detection is automatic (when using AX_AVAILABLE_SYSTEMD)
0cd2a77
to
a1c0a38
I fixed up this PR so our packages use this and tested the resulting packages |
We now also install our dnsdist.service file from make install.
Needs review