diff options
Diffstat (limited to 'debian/patches/sigstop.patch')
-rw-r--r-- | debian/patches/sigstop.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/patches/sigstop.patch b/debian/patches/sigstop.patch new file mode 100644 index 000000000..a7eb5996e --- /dev/null +++ b/debian/patches/sigstop.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 92c6b1dc352b03c7bdecc6ce9bfef7a3b2b54bbc Mon Sep 17 00:00:00 2001 | ||
2 | From: Colin Watson <cjwatson@debian.org> | ||
3 | Date: Sun, 9 Feb 2014 16:10:17 +0000 | ||
4 | Subject: Support synchronisation with service supervisor using SIGSTOP | ||
5 | |||
6 | Author: Robie Basak <robie.basak@ubuntu.com> | ||
7 | Forwarded: no | ||
8 | Last-Update: 2014-04-14 | ||
9 | |||
10 | Patch-Name: sigstop.patch | ||
11 | --- | ||
12 | sshd.c | 10 ++++++++++ | ||
13 | 1 file changed, 10 insertions(+) | ||
14 | |||
15 | diff --git a/sshd.c b/sshd.c | ||
16 | index 6024e0e..7e72b9b 100644 | ||
17 | --- a/sshd.c | ||
18 | +++ b/sshd.c | ||
19 | @@ -2042,6 +2042,16 @@ main(int ac, char **av) | ||
20 | } | ||
21 | } | ||
22 | |||
23 | + if (getenv("SSH_SIGSTOP")) { | ||
24 | + /* Tell service supervisor that we are ready. */ | ||
25 | + kill(getpid(), SIGSTOP); | ||
26 | + /* The service supervisor only ever expects a single | ||
27 | + * STOP signal, so do not ever signal it again, even | ||
28 | + * in the case of a re-exec or future children. | ||
29 | + */ | ||
30 | + unsetenv("SSH_SIGSTOP"); | ||
31 | + } | ||
32 | + | ||
33 | /* Accept a connection and return in a forked child */ | ||
34 | server_accept_loop(&sock_in, &sock_out, | ||
35 | &newsock, config_s); | ||