diff options
author | Michael Biebl <biebl@debian.org> | 2015-12-21 16:08:47 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-12-26 00:56:00 +0000 |
commit | c95bb2c6a018688e44481bf1d199607db567fd9e (patch) | |
tree | 025a5458c32f2f5cd0657de2289615e564ceb576 /sshd.c | |
parent | e6e10c563bbe69426d5074b0b97e2a9b0b4b3b49 (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 "ssh2.h" | 94 | #include "ssh2.h" |
@@ -1888,6 +1892,11 @@ main(int ac, char **av) | |||
1888 | unsetenv("SSH_SIGSTOP"); | 1892 | unsetenv("SSH_SIGSTOP"); |
1889 | } | 1893 | } |
1890 | 1894 | ||
1895 | #ifdef HAVE_SYSTEMD | ||
1896 | /* Signal systemd that we are ready to accept connections */ | ||
1897 | sd_notify(0, "READY=1"); | ||
1898 | #endif | ||
1899 | |||
1891 | /* Accept a connection and return in a forked child */ | 1900 | /* Accept a connection and return in a forked child */ |
1892 | server_accept_loop(&sock_in, &sock_out, | 1901 | server_accept_loop(&sock_in, &sock_out, |
1893 | &newsock, config_s); | 1902 | &newsock, config_s); |