diff options
-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 917300b43..8a5db4cb5 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -4586,6 +4586,29 @@ AC_ARG_WITH([kerberos5], | |||
4586 | AC_SUBST([GSSLIBS]) | 4586 | AC_SUBST([GSSLIBS]) |
4587 | AC_SUBST([K5LIBS]) | 4587 | AC_SUBST([K5LIBS]) |
4588 | 4588 | ||
4589 | # Check whether user wants systemd support | ||
4590 | SYSTEMD_MSG="no" | ||
4591 | AC_ARG_WITH(systemd, | ||
4592 | [ --with-systemd Enable systemd support], | ||
4593 | [ if test "x$withval" != "xno" ; then | ||
4594 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
4595 | if test "$PKGCONFIG" != "no"; then | ||
4596 | AC_MSG_CHECKING([for libsystemd]) | ||
4597 | if $PKGCONFIG --exists libsystemd; then | ||
4598 | SYSTEMD_CFLAGS=`$PKGCONFIG --cflags libsystemd` | ||
4599 | SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd` | ||
4600 | CPPFLAGS="$CPPFLAGS $SYSTEMD_CFLAGS" | ||
4601 | SSHDLIBS="$SSHDLIBS $SYSTEMD_LIBS" | ||
4602 | AC_MSG_RESULT([yes]) | ||
4603 | AC_DEFINE(HAVE_SYSTEMD, 1, [Define if you want systemd support.]) | ||
4604 | SYSTEMD_MSG="yes" | ||
4605 | else | ||
4606 | AC_MSG_RESULT([no]) | ||
4607 | fi | ||
4608 | fi | ||
4609 | fi ] | ||
4610 | ) | ||
4611 | |||
4589 | # Looking for programs, paths and files | 4612 | # Looking for programs, paths and files |
4590 | 4613 | ||
4591 | PRIVSEP_PATH=/var/empty | 4614 | PRIVSEP_PATH=/var/empty |
@@ -5392,6 +5415,7 @@ echo " libldns support: $LDNS_MSG" | |||
5392 | echo " Solaris process contract support: $SPC_MSG" | 5415 | echo " Solaris process contract support: $SPC_MSG" |
5393 | echo " Solaris project support: $SP_MSG" | 5416 | echo " Solaris project support: $SP_MSG" |
5394 | echo " Solaris privilege support: $SPP_MSG" | 5417 | echo " Solaris privilege support: $SPP_MSG" |
5418 | echo " systemd support: $SYSTEMD_MSG" | ||
5395 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | 5419 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
5396 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | 5420 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
5397 | echo " BSD Auth support: $BSD_AUTH_MSG" | 5421 | 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" |
@@ -1990,6 +1994,11 @@ main(int ac, char **av) | |||
1990 | } | 1994 | } |
1991 | } | 1995 | } |
1992 | 1996 | ||
1997 | #ifdef HAVE_SYSTEMD | ||
1998 | /* Signal systemd that we are ready to accept connections */ | ||
1999 | sd_notify(0, "READY=1"); | ||
2000 | #endif | ||
2001 | |||
1993 | /* Accept a connection and return in a forked child */ | 2002 | /* Accept a connection and return in a forked child */ |
1994 | server_accept_loop(&sock_in, &sock_out, | 2003 | server_accept_loop(&sock_in, &sock_out, |
1995 | &newsock, config_s); | 2004 | &newsock, config_s); |