summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-02-09 16:10:17 +0000
committerColin Watson <cjwatson@debian.org>2016-12-28 20:05:07 +0000
commit78a2f42f1ae8a81e2a229405273b2c1369667b5c (patch)
treea89ff15389de3e2e7f6194155e0ff01d4dcfcd87
parentc5aacd35abd57633871aa81af2e089deb5f72aab (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);