diff options
author | Michael Biebl <biebl@debian.org> | 2015-12-21 16:08:47 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-03-29 01:40:56 +0100 |
commit | bd5c1cc302550e4caf8c3a6942f48a784f347b58 (patch) | |
tree | edfeafbf71d21b05557dd48a294baab0ce509f7f /sshd.c | |
parent | a91715df66fc2a0b7792e87a864c334f4cb15043 (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" |
@@ -1902,6 +1906,11 @@ main(int ac, char **av) | |||
1902 | unsetenv("SSH_SIGSTOP"); | 1906 | unsetenv("SSH_SIGSTOP"); |
1903 | } | 1907 | } |
1904 | 1908 | ||
1909 | #ifdef HAVE_SYSTEMD | ||
1910 | /* Signal systemd that we are ready to accept connections */ | ||
1911 | sd_notify(0, "READY=1"); | ||
1912 | #endif | ||
1913 | |||
1905 | /* Accept a connection and return in a forked child */ | 1914 | /* Accept a connection and return in a forked child */ |
1906 | server_accept_loop(&sock_in, &sock_out, | 1915 | server_accept_loop(&sock_in, &sock_out, |
1907 | &newsock, config_s); | 1916 | &newsock, config_s); |