diff options
author | Michael Biebl <biebl@debian.org> | 2015-12-21 16:08:47 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-08-07 12:18:44 +0100 |
commit | fe97848e044743f0bac019a491ddf0138f84e14a (patch) | |
tree | 0084a88c61978fb65b803aa85c001e25b89c8f1b | |
parent | 8d765e441787d024e76369496316105fe736d3ba (diff) |
Add systemd readiness notification support
Bug-Debian: https://bugs.debian.org/778913
Forwarded: no
Last-Update: 2016-01-04
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 f822fb31c..6cafb1535 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -4319,6 +4319,29 @@ AC_ARG_WITH([kerberos5], | |||
4319 | AC_SUBST([GSSLIBS]) | 4319 | AC_SUBST([GSSLIBS]) |
4320 | AC_SUBST([K5LIBS]) | 4320 | AC_SUBST([K5LIBS]) |
4321 | 4321 | ||
4322 | # Check whether user wants systemd support | ||
4323 | SYSTEMD_MSG="no" | ||
4324 | AC_ARG_WITH(systemd, | ||
4325 | [ --with-systemd Enable systemd support], | ||
4326 | [ if test "x$withval" != "xno" ; then | ||
4327 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
4328 | if test "$PKGCONFIG" != "no"; then | ||
4329 | AC_MSG_CHECKING([for libsystemd]) | ||
4330 | if $PKGCONFIG --exists libsystemd; then | ||
4331 | SYSTEMD_CFLAGS=`$PKGCONFIG --cflags libsystemd` | ||
4332 | SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd` | ||
4333 | CPPFLAGS="$CPPFLAGS $SYSTEMD_CFLAGS" | ||
4334 | SSHDLIBS="$SSHDLIBS $SYSTEMD_LIBS" | ||
4335 | AC_MSG_RESULT([yes]) | ||
4336 | AC_DEFINE(HAVE_SYSTEMD, 1, [Define if you want systemd support.]) | ||
4337 | SYSTEMD_MSG="yes" | ||
4338 | else | ||
4339 | AC_MSG_RESULT([no]) | ||
4340 | fi | ||
4341 | fi | ||
4342 | fi ] | ||
4343 | ) | ||
4344 | |||
4322 | # Looking for programs, paths and files | 4345 | # Looking for programs, paths and files |
4323 | 4346 | ||
4324 | PRIVSEP_PATH=/var/empty | 4347 | PRIVSEP_PATH=/var/empty |
@@ -5121,6 +5144,7 @@ echo " libedit support: $LIBEDIT_MSG" | |||
5121 | echo " Solaris process contract support: $SPC_MSG" | 5144 | echo " Solaris process contract support: $SPC_MSG" |
5122 | echo " Solaris project support: $SP_MSG" | 5145 | echo " Solaris project support: $SP_MSG" |
5123 | echo " Solaris privilege support: $SPP_MSG" | 5146 | echo " Solaris privilege support: $SPP_MSG" |
5147 | echo " systemd support: $SYSTEMD_MSG" | ||
5124 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | 5148 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
5125 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | 5149 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
5126 | echo " BSD Auth support: $BSD_AUTH_MSG" | 5150 | 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 "ssh1.h" | 94 | #include "ssh1.h" |
@@ -2117,6 +2121,11 @@ main(int ac, char **av) | |||
2117 | unsetenv("SSH_SIGSTOP"); | 2121 | unsetenv("SSH_SIGSTOP"); |
2118 | } | 2122 | } |
2119 | 2123 | ||
2124 | #ifdef HAVE_SYSTEMD | ||
2125 | /* Signal systemd that we are ready to accept connections */ | ||
2126 | sd_notify(0, "READY=1"); | ||
2127 | #endif | ||
2128 | |||
2120 | /* Accept a connection and return in a forked child */ | 2129 | /* Accept a connection and return in a forked child */ |
2121 | server_accept_loop(&sock_in, &sock_out, | 2130 | server_accept_loop(&sock_in, &sock_out, |
2122 | &newsock, config_s); | 2131 | &newsock, config_s); |