From 7ce7aa96b03196d9d799f4caf6e4c7c6c2bed7da Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 9 Feb 2014 16:10:17 +0000 Subject: Support synchronisation with service supervisor using SIGSTOP Author: Robie Basak Forwarded: no Last-Update: 2014-04-14 Patch-Name: sigstop.patch --- sshd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sshd.c') diff --git a/sshd.c b/sshd.c index 6024e0e73..7e72b9b84 100644 --- a/sshd.c +++ b/sshd.c @@ -2042,6 +2042,16 @@ main(int ac, char **av) } } + if (getenv("SSH_SIGSTOP")) { + /* Tell service supervisor that we are ready. */ + kill(getpid(), SIGSTOP); + /* The service supervisor only ever expects a single + * STOP signal, so do not ever signal it again, even + * in the case of a re-exec or future children. + */ + unsetenv("SSH_SIGSTOP"); + } + /* Accept a connection and return in a forked child */ server_accept_loop(&sock_in, &sock_out, &newsock, config_s); -- cgit v1.2.3