summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac24
-rw-r--r--sshd.c9
2 files changed, 33 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index a92425dbc..9d89bc351 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4376,6 +4376,29 @@ AC_ARG_WITH([kerberos5],
4376AC_SUBST([GSSLIBS]) 4376AC_SUBST([GSSLIBS])
4377AC_SUBST([K5LIBS]) 4377AC_SUBST([K5LIBS])
4378 4378
4379# Check whether user wants systemd support
4380SYSTEMD_MSG="no"
4381AC_ARG_WITH(systemd,
4382 [ --with-systemd Enable systemd support],
4383 [ if test "x$withval" != "xno" ; then
4384 AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no])
4385 if test "$PKGCONFIG" != "no"; then
4386 AC_MSG_CHECKING([for libsystemd])
4387 if $PKGCONFIG --exists libsystemd; then
4388 SYSTEMD_CFLAGS=`$PKGCONFIG --cflags libsystemd`
4389 SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd`
4390 CPPFLAGS="$CPPFLAGS $SYSTEMD_CFLAGS"
4391 SSHDLIBS="$SSHDLIBS $SYSTEMD_LIBS"
4392 AC_MSG_RESULT([yes])
4393 AC_DEFINE(HAVE_SYSTEMD, 1, [Define if you want systemd support.])
4394 SYSTEMD_MSG="yes"
4395 else
4396 AC_MSG_RESULT([no])
4397 fi
4398 fi
4399 fi ]
4400)
4401
4379# Looking for programs, paths and files 4402# Looking for programs, paths and files
4380 4403
4381PRIVSEP_PATH=/var/empty 4404PRIVSEP_PATH=/var/empty
@@ -5180,6 +5203,7 @@ echo " libldns support: $LDNS_MSG"
5180echo " Solaris process contract support: $SPC_MSG" 5203echo " Solaris process contract support: $SPC_MSG"
5181echo " Solaris project support: $SP_MSG" 5204echo " Solaris project support: $SP_MSG"
5182echo " Solaris privilege support: $SPP_MSG" 5205echo " Solaris privilege support: $SPP_MSG"
5206echo " systemd support: $SYSTEMD_MSG"
5183echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" 5207echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
5184echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" 5208echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
5185echo " BSD Auth support: $BSD_AUTH_MSG" 5209echo " BSD Auth support: $BSD_AUTH_MSG"
diff --git a/sshd.c b/sshd.c
index f2f54b510..44772c6dd 100644
--- a/sshd.c
+++ b/sshd.c
@@ -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"
@@ -1892,6 +1896,11 @@ main(int ac, char **av)
1892 } 1896 }
1893 } 1897 }
1894 1898
1899#ifdef HAVE_SYSTEMD
1900 /* Signal systemd that we are ready to accept connections */
1901 sd_notify(0, "READY=1");
1902#endif
1903
1895 /* Accept a connection and return in a forked child */ 1904 /* Accept a connection and return in a forked child */
1896 server_accept_loop(&sock_in, &sock_out, 1905 server_accept_loop(&sock_in, &sock_out,
1897 &newsock, config_s); 1906 &newsock, config_s);