summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-02-09 16:10:17 +0000
committerColin Watson <cjwatson@debian.org>2017-01-16 15:02:54 +0000
commit218ecbc433b69b8584000380626a9d9aa31c095b (patch)
treecf485466239c37a93d3667c38e67142e4739c8f7
parent0327e9b3a5f6d1e945f1f028e742e14cf5823962 (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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sshd.c b/sshd.c
index eebf19841..b6826c842 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1878,6 +1878,16 @@ main(int ac, char **av)
1878 } 1878 }
1879 } 1879 }
1880 1880
1881 if (getenv("SSH_SIGSTOP")) {
1882 /* Tell service supervisor that we are ready. */
1883 kill(getpid(), SIGSTOP);
1884 /* The service supervisor only ever expects a single
1885 * STOP signal, so do not ever signal it again, even
1886 * in the case of a re-exec or future children.
1887 */
1888 unsetenv("SSH_SIGSTOP");
1889 }
1890
1881 /* Accept a connection and return in a forked child */ 1891 /* Accept a connection and return in a forked child */
1882 server_accept_loop(&sock_in, &sock_out, 1892 server_accept_loop(&sock_in, &sock_out,
1883 &newsock, config_s); 1893 &newsock, config_s);