diff options
author | Colin Watson <cjwatson@debian.org> | 2014-02-09 16:10:17 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-08-07 12:18:44 +0100 |
commit | 8d765e441787d024e76369496316105fe736d3ba (patch) | |
tree | d8936a2e29d800c64597128389194d28eb8a50d8 /sshd.c | |
parent | db85bf41862b80b0447777d942a091cd3ac5f1c1 (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
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -2107,6 +2107,16 @@ main(int ac, char **av) | |||
2107 | } | 2107 | } |
2108 | } | 2108 | } |
2109 | 2109 | ||
2110 | if (getenv("SSH_SIGSTOP")) { | ||
2111 | /* Tell service supervisor that we are ready. */ | ||
2112 | kill(getpid(), SIGSTOP); | ||
2113 | /* The service supervisor only ever expects a single | ||
2114 | * STOP signal, so do not ever signal it again, even | ||
2115 | * in the case of a re-exec or future children. | ||
2116 | */ | ||
2117 | unsetenv("SSH_SIGSTOP"); | ||
2118 | } | ||
2119 | |||
2110 | /* Accept a connection and return in a forked child */ | 2120 | /* Accept a connection and return in a forked child */ |
2111 | server_accept_loop(&sock_in, &sock_out, | 2121 | server_accept_loop(&sock_in, &sock_out, |
2112 | &newsock, config_s); | 2122 | &newsock, config_s); |