diff options
author | Michael Biebl <biebl@debian.org> | 2015-12-21 16:08:47 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-03-21 12:06:16 +0000 |
commit | 643bc17ada741a9ee5b86170ad313f83278e1f72 (patch) | |
tree | 04547ad9b5c583418121bad864385e9d6495ca8f | |
parent | 803865858838e2ccf1fa885ba14b9a11c4a3153e (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 5d720f77a..c978c1104 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -4263,6 +4263,29 @@ AC_ARG_WITH([kerberos5], | |||
4263 | AC_SUBST([GSSLIBS]) | 4263 | AC_SUBST([GSSLIBS]) |
4264 | AC_SUBST([K5LIBS]) | 4264 | AC_SUBST([K5LIBS]) |
4265 | 4265 | ||
4266 | # Check whether user wants systemd support | ||
4267 | SYSTEMD_MSG="no" | ||
4268 | AC_ARG_WITH(systemd, | ||
4269 | [ --with-systemd Enable systemd support], | ||
4270 | [ if test "x$withval" != "xno" ; then | ||
4271 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
4272 | if test "$PKGCONFIG" != "no"; then | ||
4273 | AC_MSG_CHECKING([for libsystemd]) | ||
4274 | if $PKGCONFIG --exists libsystemd; then | ||
4275 | SYSTEMD_CFLAGS=`$PKGCONFIG --cflags libsystemd` | ||
4276 | SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd` | ||
4277 | CPPFLAGS="$CPPFLAGS $SYSTEMD_CFLAGS" | ||
4278 | SSHDLIBS="$SSHDLIBS $SYSTEMD_LIBS" | ||
4279 | AC_MSG_RESULT([yes]) | ||
4280 | AC_DEFINE(HAVE_SYSTEMD, 1, [Define if you want systemd support.]) | ||
4281 | SYSTEMD_MSG="yes" | ||
4282 | else | ||
4283 | AC_MSG_RESULT([no]) | ||
4284 | fi | ||
4285 | fi | ||
4286 | fi ] | ||
4287 | ) | ||
4288 | |||
4266 | # Looking for programs, paths and files | 4289 | # Looking for programs, paths and files |
4267 | 4290 | ||
4268 | PRIVSEP_PATH=/var/empty | 4291 | PRIVSEP_PATH=/var/empty |
@@ -5065,6 +5088,7 @@ echo " libedit support: $LIBEDIT_MSG" | |||
5065 | echo " Solaris process contract support: $SPC_MSG" | 5088 | echo " Solaris process contract support: $SPC_MSG" |
5066 | echo " Solaris project support: $SP_MSG" | 5089 | echo " Solaris project support: $SP_MSG" |
5067 | echo " Solaris privilege support: $SPP_MSG" | 5090 | echo " Solaris privilege support: $SPP_MSG" |
5091 | echo " systemd support: $SYSTEMD_MSG" | ||
5068 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | 5092 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
5069 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | 5093 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
5070 | echo " BSD Auth support: $BSD_AUTH_MSG" | 5094 | 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" |
@@ -2058,6 +2062,11 @@ main(int ac, char **av) | |||
2058 | unsetenv("SSH_SIGSTOP"); | 2062 | unsetenv("SSH_SIGSTOP"); |
2059 | } | 2063 | } |
2060 | 2064 | ||
2065 | #ifdef HAVE_SYSTEMD | ||
2066 | /* Signal systemd that we are ready to accept connections */ | ||
2067 | sd_notify(0, "READY=1"); | ||
2068 | #endif | ||
2069 | |||
2061 | /* Accept a connection and return in a forked child */ | 2070 | /* Accept a connection and return in a forked child */ |
2062 | server_accept_loop(&sock_in, &sock_out, | 2071 | server_accept_loop(&sock_in, &sock_out, |
2063 | &newsock, config_s); | 2072 | &newsock, config_s); |