diff options
author | Colin Watson <cjwatson@debian.org> | 2014-02-09 16:10:17 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-02-29 12:35:09 +0000 |
commit | e66add5020e18f6dd9b942b46e02d9b20e24edcc (patch) | |
tree | f852f4d787466f199ff8e7659ac927d27e55ddf0 | |
parent | 5e5d8faea814efa9368ccec343580b6dcd440d5e (diff) |
Support synchronisation with service supervisor using SIGSTOP
Author: Robie Basak <robie.basak@ubuntu.com>
Forwarded: no
Last-Update: 2014-04-14
Patch-Name: sigstop.patch
-rw-r--r-- | sshd.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -2048,6 +2048,16 @@ main(int ac, char **av) | |||
2048 | } | 2048 | } |
2049 | } | 2049 | } |
2050 | 2050 | ||
2051 | if (getenv("SSH_SIGSTOP")) { | ||
2052 | /* Tell service supervisor that we are ready. */ | ||
2053 | kill(getpid(), SIGSTOP); | ||
2054 | /* The service supervisor only ever expects a single | ||
2055 | * STOP signal, so do not ever signal it again, even | ||
2056 | * in the case of a re-exec or future children. | ||
2057 | */ | ||
2058 | unsetenv("SSH_SIGSTOP"); | ||
2059 | } | ||
2060 | |||
2051 | /* Accept a connection and return in a forked child */ | 2061 | /* Accept a connection and return in a forked child */ |
2052 | server_accept_loop(&sock_in, &sock_out, | 2062 | server_accept_loop(&sock_in, &sock_out, |
2053 | &newsock, config_s); | 2063 | &newsock, config_s); |