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 bb435ec1f..5944299fa 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -4785,6 +4785,29 @@ AC_ARG_WITH([kerberos5], | |||
4785 | AC_SUBST([GSSLIBS]) | 4785 | AC_SUBST([GSSLIBS]) |
4786 | AC_SUBST([K5LIBS]) | 4786 | AC_SUBST([K5LIBS]) |
4787 | 4787 | ||
4788 | # Check whether user wants systemd support | ||
4789 | SYSTEMD_MSG="no" | ||
4790 | AC_ARG_WITH(systemd, | ||
4791 | [ --with-systemd Enable systemd support], | ||
4792 | [ if test "x$withval" != "xno" ; then | ||
4793 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
4794 | if test "$PKGCONFIG" != "no"; then | ||
4795 | AC_MSG_CHECKING([for libsystemd]) | ||
4796 | if $PKGCONFIG --exists libsystemd; then | ||
4797 | SYSTEMD_CFLAGS=`$PKGCONFIG --cflags libsystemd` | ||
4798 | SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd` | ||
4799 | CPPFLAGS="$CPPFLAGS $SYSTEMD_CFLAGS" | ||
4800 | SSHDLIBS="$SSHDLIBS $SYSTEMD_LIBS" | ||
4801 | AC_MSG_RESULT([yes]) | ||
4802 | AC_DEFINE(HAVE_SYSTEMD, 1, [Define if you want systemd support.]) | ||
4803 | SYSTEMD_MSG="yes" | ||
4804 | else | ||
4805 | AC_MSG_RESULT([no]) | ||
4806 | fi | ||
4807 | fi | ||
4808 | fi ] | ||
4809 | ) | ||
4810 | |||
4788 | # Looking for programs, paths and files | 4811 | # Looking for programs, paths and files |
4789 | 4812 | ||
4790 | PRIVSEP_PATH=/var/empty | 4813 | PRIVSEP_PATH=/var/empty |
@@ -5599,6 +5622,7 @@ echo " libldns support: $LDNS_MSG" | |||
5599 | echo " Solaris process contract support: $SPC_MSG" | 5622 | echo " Solaris process contract support: $SPC_MSG" |
5600 | echo " Solaris project support: $SP_MSG" | 5623 | echo " Solaris project support: $SP_MSG" |
5601 | echo " Solaris privilege support: $SPP_MSG" | 5624 | echo " Solaris privilege support: $SPP_MSG" |
5625 | echo " systemd support: $SYSTEMD_MSG" | ||
5602 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | 5626 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
5603 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | 5627 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
5604 | echo " BSD Auth support: $BSD_AUTH_MSG" | 5628 | 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" |
@@ -2076,6 +2080,11 @@ main(int ac, char **av) | |||
2076 | } | 2080 | } |
2077 | } | 2081 | } |
2078 | 2082 | ||
2083 | #ifdef HAVE_SYSTEMD | ||
2084 | /* Signal systemd that we are ready to accept connections */ | ||
2085 | sd_notify(0, "READY=1"); | ||
2086 | #endif | ||
2087 | |||
2079 | /* Accept a connection and return in a forked child */ | 2088 | /* Accept a connection and return in a forked child */ |
2080 | server_accept_loop(&sock_in, &sock_out, | 2089 | server_accept_loop(&sock_in, &sock_out, |
2081 | &newsock, config_s); | 2090 | &newsock, config_s); |