diff options
author | Michael Biebl <biebl@debian.org> | 2015-12-21 16:08:47 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2018-04-03 18:40:49 +0100 |
commit | 4acdde3e5b206718774fa162763058155fe572bf (patch) | |
tree | ae5a8280662bdc82c832c8d7724a992a46bd563c | |
parent | 4ccb07d2ebea1b01b56a455790224ce97a0b36e8 (diff) |
Add systemd readiness notification support
Bug-Debian: https://bugs.debian.org/778913
Forwarded: no
Last-Update: 2017-08-22
Patch-Name: systemd-readiness.patch
-rw-r--r-- | configure.ac | 24 | ||||
-rw-r--r-- | sshd.c | 9 |
2 files changed, 33 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 3e23e60d6..eac143b4d 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -4496,6 +4496,29 @@ AC_ARG_WITH([kerberos5], | |||
4496 | AC_SUBST([GSSLIBS]) | 4496 | AC_SUBST([GSSLIBS]) |
4497 | AC_SUBST([K5LIBS]) | 4497 | AC_SUBST([K5LIBS]) |
4498 | 4498 | ||
4499 | # Check whether user wants systemd support | ||
4500 | SYSTEMD_MSG="no" | ||
4501 | AC_ARG_WITH(systemd, | ||
4502 | [ --with-systemd Enable systemd support], | ||
4503 | [ if test "x$withval" != "xno" ; then | ||
4504 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
4505 | if test "$PKGCONFIG" != "no"; then | ||
4506 | AC_MSG_CHECKING([for libsystemd]) | ||
4507 | if $PKGCONFIG --exists libsystemd; then | ||
4508 | SYSTEMD_CFLAGS=`$PKGCONFIG --cflags libsystemd` | ||
4509 | SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd` | ||
4510 | CPPFLAGS="$CPPFLAGS $SYSTEMD_CFLAGS" | ||
4511 | SSHDLIBS="$SSHDLIBS $SYSTEMD_LIBS" | ||
4512 | AC_MSG_RESULT([yes]) | ||
4513 | AC_DEFINE(HAVE_SYSTEMD, 1, [Define if you want systemd support.]) | ||
4514 | SYSTEMD_MSG="yes" | ||
4515 | else | ||
4516 | AC_MSG_RESULT([no]) | ||
4517 | fi | ||
4518 | fi | ||
4519 | fi ] | ||
4520 | ) | ||
4521 | |||
4499 | # Looking for programs, paths and files | 4522 | # Looking for programs, paths and files |
4500 | 4523 | ||
4501 | PRIVSEP_PATH=/var/empty | 4524 | PRIVSEP_PATH=/var/empty |
@@ -5303,6 +5326,7 @@ echo " libldns support: $LDNS_MSG" | |||
5303 | echo " Solaris process contract support: $SPC_MSG" | 5326 | echo " Solaris process contract support: $SPC_MSG" |
5304 | echo " Solaris project support: $SP_MSG" | 5327 | echo " Solaris project support: $SP_MSG" |
5305 | echo " Solaris privilege support: $SPP_MSG" | 5328 | echo " Solaris privilege support: $SPP_MSG" |
5329 | echo " systemd support: $SYSTEMD_MSG" | ||
5306 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | 5330 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
5307 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | 5331 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
5308 | echo " BSD Auth support: $BSD_AUTH_MSG" | 5332 | echo " BSD Auth support: $BSD_AUTH_MSG" |
@@ -85,6 +85,10 @@ | |||
85 | #include <prot.h> | 85 | #include <prot.h> |
86 | #endif | 86 | #endif |
87 | 87 | ||
88 | #ifdef HAVE_SYSTEMD | ||
89 | #include <systemd/sd-daemon.h> | ||
90 | #endif | ||
91 | |||
88 | #include "xmalloc.h" | 92 | #include "xmalloc.h" |
89 | #include "ssh.h" | 93 | #include "ssh.h" |
90 | #include "ssh2.h" | 94 | #include "ssh2.h" |
@@ -1933,6 +1937,11 @@ main(int ac, char **av) | |||
1933 | } | 1937 | } |
1934 | } | 1938 | } |
1935 | 1939 | ||
1940 | #ifdef HAVE_SYSTEMD | ||
1941 | /* Signal systemd that we are ready to accept connections */ | ||
1942 | sd_notify(0, "READY=1"); | ||
1943 | #endif | ||
1944 | |||
1936 | /* Accept a connection and return in a forked child */ | 1945 | /* Accept a connection and return in a forked child */ |
1937 | server_accept_loop(&sock_in, &sock_out, | 1946 | server_accept_loop(&sock_in, &sock_out, |
1938 | &newsock, config_s); | 1947 | &newsock, config_s); |