diff options
author | Michael Biebl <biebl@debian.org> | 2015-12-21 16:08:47 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-01-16 15:02:54 +0000 |
commit | 0fd4134a3ef467e1e69db5b19b7903cf306ec64b (patch) | |
tree | 88aaff5e5238955b39f9ecca5d899cff6c339030 | |
parent | 218ecbc433b69b8584000380626a9d9aa31c095b (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 4747ce4a5..9f59794bc 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -4364,6 +4364,29 @@ AC_ARG_WITH([kerberos5], | |||
4364 | AC_SUBST([GSSLIBS]) | 4364 | AC_SUBST([GSSLIBS]) |
4365 | AC_SUBST([K5LIBS]) | 4365 | AC_SUBST([K5LIBS]) |
4366 | 4366 | ||
4367 | # Check whether user wants systemd support | ||
4368 | SYSTEMD_MSG="no" | ||
4369 | AC_ARG_WITH(systemd, | ||
4370 | [ --with-systemd Enable systemd support], | ||
4371 | [ if test "x$withval" != "xno" ; then | ||
4372 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
4373 | if test "$PKGCONFIG" != "no"; then | ||
4374 | AC_MSG_CHECKING([for libsystemd]) | ||
4375 | if $PKGCONFIG --exists libsystemd; then | ||
4376 | SYSTEMD_CFLAGS=`$PKGCONFIG --cflags libsystemd` | ||
4377 | SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd` | ||
4378 | CPPFLAGS="$CPPFLAGS $SYSTEMD_CFLAGS" | ||
4379 | SSHDLIBS="$SSHDLIBS $SYSTEMD_LIBS" | ||
4380 | AC_MSG_RESULT([yes]) | ||
4381 | AC_DEFINE(HAVE_SYSTEMD, 1, [Define if you want systemd support.]) | ||
4382 | SYSTEMD_MSG="yes" | ||
4383 | else | ||
4384 | AC_MSG_RESULT([no]) | ||
4385 | fi | ||
4386 | fi | ||
4387 | fi ] | ||
4388 | ) | ||
4389 | |||
4367 | # Looking for programs, paths and files | 4390 | # Looking for programs, paths and files |
4368 | 4391 | ||
4369 | PRIVSEP_PATH=/var/empty | 4392 | PRIVSEP_PATH=/var/empty |
@@ -5167,6 +5190,7 @@ echo " libedit support: $LIBEDIT_MSG" | |||
5167 | echo " Solaris process contract support: $SPC_MSG" | 5190 | echo " Solaris process contract support: $SPC_MSG" |
5168 | echo " Solaris project support: $SP_MSG" | 5191 | echo " Solaris project support: $SP_MSG" |
5169 | echo " Solaris privilege support: $SPP_MSG" | 5192 | echo " Solaris privilege support: $SPP_MSG" |
5193 | echo " systemd support: $SYSTEMD_MSG" | ||
5170 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | 5194 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
5171 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | 5195 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
5172 | echo " BSD Auth support: $BSD_AUTH_MSG" | 5196 | 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" |
@@ -1888,6 +1892,11 @@ main(int ac, char **av) | |||
1888 | unsetenv("SSH_SIGSTOP"); | 1892 | unsetenv("SSH_SIGSTOP"); |
1889 | } | 1893 | } |
1890 | 1894 | ||
1895 | #ifdef HAVE_SYSTEMD | ||
1896 | /* Signal systemd that we are ready to accept connections */ | ||
1897 | sd_notify(0, "READY=1"); | ||
1898 | #endif | ||
1899 | |||
1891 | /* Accept a connection and return in a forked child */ | 1900 | /* Accept a connection and return in a forked child */ |
1892 | server_accept_loop(&sock_in, &sock_out, | 1901 | server_accept_loop(&sock_in, &sock_out, |
1893 | &newsock, config_s); | 1902 | &newsock, config_s); |