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 3b30736b3..483a9038c 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -4389,6 +4389,29 @@ AC_ARG_WITH([kerberos5], | |||
4389 | AC_SUBST([GSSLIBS]) | 4389 | AC_SUBST([GSSLIBS]) |
4390 | AC_SUBST([K5LIBS]) | 4390 | AC_SUBST([K5LIBS]) |
4391 | 4391 | ||
4392 | # Check whether user wants systemd support | ||
4393 | SYSTEMD_MSG="no" | ||
4394 | AC_ARG_WITH(systemd, | ||
4395 | [ --with-systemd Enable systemd support], | ||
4396 | [ if test "x$withval" != "xno" ; then | ||
4397 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
4398 | if test "$PKGCONFIG" != "no"; then | ||
4399 | AC_MSG_CHECKING([for libsystemd]) | ||
4400 | if $PKGCONFIG --exists libsystemd; then | ||
4401 | SYSTEMD_CFLAGS=`$PKGCONFIG --cflags libsystemd` | ||
4402 | SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd` | ||
4403 | CPPFLAGS="$CPPFLAGS $SYSTEMD_CFLAGS" | ||
4404 | SSHDLIBS="$SSHDLIBS $SYSTEMD_LIBS" | ||
4405 | AC_MSG_RESULT([yes]) | ||
4406 | AC_DEFINE(HAVE_SYSTEMD, 1, [Define if you want systemd support.]) | ||
4407 | SYSTEMD_MSG="yes" | ||
4408 | else | ||
4409 | AC_MSG_RESULT([no]) | ||
4410 | fi | ||
4411 | fi | ||
4412 | fi ] | ||
4413 | ) | ||
4414 | |||
4392 | # Looking for programs, paths and files | 4415 | # Looking for programs, paths and files |
4393 | 4416 | ||
4394 | PRIVSEP_PATH=/var/empty | 4417 | PRIVSEP_PATH=/var/empty |
@@ -5196,6 +5219,7 @@ echo " libldns support: $LDNS_MSG" | |||
5196 | echo " Solaris process contract support: $SPC_MSG" | 5219 | echo " Solaris process contract support: $SPC_MSG" |
5197 | echo " Solaris project support: $SP_MSG" | 5220 | echo " Solaris project support: $SP_MSG" |
5198 | echo " Solaris privilege support: $SPP_MSG" | 5221 | echo " Solaris privilege support: $SPP_MSG" |
5222 | echo " systemd support: $SYSTEMD_MSG" | ||
5199 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | 5223 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
5200 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | 5224 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
5201 | echo " BSD Auth support: $BSD_AUTH_MSG" | 5225 | 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" |
@@ -1881,6 +1885,11 @@ main(int ac, char **av) | |||
1881 | } | 1885 | } |
1882 | } | 1886 | } |
1883 | 1887 | ||
1888 | #ifdef HAVE_SYSTEMD | ||
1889 | /* Signal systemd that we are ready to accept connections */ | ||
1890 | sd_notify(0, "READY=1"); | ||
1891 | #endif | ||
1892 | |||
1884 | /* Accept a connection and return in a forked child */ | 1893 | /* Accept a connection and return in a forked child */ |
1885 | server_accept_loop(&sock_in, &sock_out, | 1894 | server_accept_loop(&sock_in, &sock_out, |
1886 | &newsock, config_s); | 1895 | &newsock, config_s); |