diff options
Diffstat (limited to 'debian/patches/sigstop.patch')
-rw-r--r-- | debian/patches/sigstop.patch | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/debian/patches/sigstop.patch b/debian/patches/sigstop.patch index 91c9d5434..6a15e0dc5 100644 --- a/debian/patches/sigstop.patch +++ b/debian/patches/sigstop.patch | |||
@@ -1,27 +1,34 @@ | |||
1 | From d9ac4d127f53d92cf3426fba28ff351e5e165ae2 Mon Sep 17 00:00:00 2001 | 1 | From cfeaa0ba2ce2859573f7e980be09ef05511f56a2 Mon Sep 17 00:00:00 2001 |
2 | From: Colin Watson <cjwatson@debian.org> | 2 | From: Colin Watson <cjwatson@debian.org> |
3 | Date: Sun, 9 Feb 2014 16:10:17 +0000 | 3 | Date: Sun, 9 Feb 2014 16:10:17 +0000 |
4 | Subject: Support synchronisation with service supervisor using SIGSTOP | 4 | Subject: Support synchronisation with service supervisor using SIGSTOP |
5 | 5 | ||
6 | Author: Robie Basak <robie.basak@ubuntu.com> | ||
6 | Forwarded: no | 7 | Forwarded: no |
7 | Last-Update: 2013-09-14 | 8 | Last-Update: 2014-04-14 |
8 | 9 | ||
9 | Patch-Name: sigstop.patch | 10 | Patch-Name: sigstop.patch |
10 | --- | 11 | --- |
11 | sshd.c | 4 ++++ | 12 | sshd.c | 10 ++++++++++ |
12 | 1 file changed, 4 insertions(+) | 13 | 1 file changed, 10 insertions(+) |
13 | 14 | ||
14 | diff --git a/sshd.c b/sshd.c | 15 | diff --git a/sshd.c b/sshd.c |
15 | index 665c0b9..ffe360c 100644 | 16 | index 665c0b9..0964491 100644 |
16 | --- a/sshd.c | 17 | --- a/sshd.c |
17 | +++ b/sshd.c | 18 | +++ b/sshd.c |
18 | @@ -1931,6 +1931,10 @@ main(int ac, char **av) | 19 | @@ -1931,6 +1931,16 @@ main(int ac, char **av) |
19 | } | 20 | } |
20 | } | 21 | } |
21 | 22 | ||
22 | + if (getenv("SSH_SIGSTOP")) | 23 | + if (getenv("SSH_SIGSTOP")) { |
23 | + /* Tell service supervisor that we are ready. */ | 24 | + /* Tell service supervisor that we are ready. */ |
24 | + kill(getpid(), SIGSTOP); | 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 | + } | ||
25 | + | 32 | + |
26 | /* Accept a connection and return in a forked child */ | 33 | /* Accept a connection and return in a forked child */ |
27 | server_accept_loop(&sock_in, &sock_out, | 34 | server_accept_loop(&sock_in, &sock_out, |