diff options
author | Michael Biebl <biebl@debian.org> | 2015-12-21 16:08:47 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2018-10-20 22:54:09 +0100 |
commit | da34947128351bee9d2530574432190548f5be58 (patch) | |
tree | da566d85ec60bbc41c826640196808fc51709a3c /sshd.c | |
parent | df56506f727e37c13346259bdcd5975e257a259d (diff) |
Add systemd readiness notification support
Bug-Debian: https://bugs.debian.org/778913
Forwarded: no
Last-Update: 2017-08-22
Patch-Name: systemd-readiness.patch
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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); |