summaryrefslogtreecommitdiff
path: root/debian/patches/sigstop.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/sigstop.patch')
-rw-r--r--debian/patches/sigstop.patch35
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..1eaa7758b
--- /dev/null
+++ b/debian/patches/sigstop.patch
@@ -0,0 +1,35 @@
1From 689f465c66059e527974c6d4ea8e95f04d5abab7 Mon Sep 17 00:00:00 2001
2From: Colin Watson <cjwatson@debian.org>
3Date: Sun, 9 Feb 2014 16:10:17 +0000
4Subject: Support synchronisation with service supervisor using SIGSTOP
5
6Author: Robie Basak <robie.basak@ubuntu.com>
7Forwarded: no
8Last-Update: 2014-04-14
9
10Patch-Name: sigstop.patch
11---
12 sshd.c | 10 ++++++++++
13 1 file changed, 10 insertions(+)
14
15diff --git a/sshd.c b/sshd.c
16index 87331c1..23d5a64 100644
17--- a/sshd.c
18+++ b/sshd.c
19@@ -1958,6 +1958,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);