diff options
author | Michael Biebl <biebl@debian.org> | 2015-12-21 16:08:47 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-03-10 13:01:05 +0000 |
commit | 8eec1f49bed1e85e4534067c4290662b7bcc3f34 (patch) | |
tree | bf506b7aae51476e4a4f4401f45303740981f672 /sshd.c | |
parent | 2b25784cfb29177fe9e19546981ab698eb422b9f (diff) |
Add systemd readiness notification support
Bug-Debian: https://bugs.debian.org/778913
Forwarded: no
Last-Update: 2016-01-04
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 "ssh1.h" | 94 | #include "ssh1.h" |
@@ -2058,6 +2062,11 @@ main(int ac, char **av) | |||
2058 | unsetenv("SSH_SIGSTOP"); | 2062 | unsetenv("SSH_SIGSTOP"); |
2059 | } | 2063 | } |
2060 | 2064 | ||
2065 | #ifdef HAVE_SYSTEMD | ||
2066 | /* Signal systemd that we are ready to accept connections */ | ||
2067 | sd_notify(0, "READY=1"); | ||
2068 | #endif | ||
2069 | |||
2061 | /* Accept a connection and return in a forked child */ | 2070 | /* Accept a connection and return in a forked child */ |
2062 | server_accept_loop(&sock_in, &sock_out, | 2071 | server_accept_loop(&sock_in, &sock_out, |
2063 | &newsock, config_s); | 2072 | &newsock, config_s); |