diff options
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | debian/openssh-server.ssh.upstart | 3 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | debian/patches/sigstop.patch | 20 | ||||
-rw-r--r-- | sshd.c | 4 |
5 files changed, 36 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 0341a15a7..9ed26d33d 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -1,3 +1,11 @@ | |||
1 | openssh (1:6.2p2-7) UNRELEASED; urgency=low | ||
2 | |||
3 | * When running under Upstart, only consider the daemon started once it is | ||
4 | ready to accept connections (by raising SIGSTOP at that point and using | ||
5 | "expect stop"). | ||
6 | |||
7 | -- Colin Watson <cjwatson@debian.org> Mon, 12 Aug 2013 12:52:19 +0100 | ||
8 | |||
1 | openssh (1:6.2p2-6) unstable; urgency=low | 9 | openssh (1:6.2p2-6) unstable; urgency=low |
2 | 10 | ||
3 | * Update config.guess and config.sub automatically at build time. | 11 | * Update config.guess and config.sub automatically at build time. |
diff --git a/debian/openssh-server.ssh.upstart b/debian/openssh-server.ssh.upstart index 21a6bc50b..10ab744f1 100644 --- a/debian/openssh-server.ssh.upstart +++ b/debian/openssh-server.ssh.upstart | |||
@@ -11,6 +11,9 @@ respawn | |||
11 | respawn limit 10 5 | 11 | respawn limit 10 5 |
12 | umask 022 | 12 | umask 022 |
13 | 13 | ||
14 | env SSH_SIGSTOP=1 | ||
15 | expect stop | ||
16 | |||
14 | # 'sshd -D' leaks stderr and confuses things in conjunction with 'console log' | 17 | # 'sshd -D' leaks stderr and confuses things in conjunction with 'console log' |
15 | console none | 18 | console none |
16 | 19 | ||
diff --git a/debian/patches/series b/debian/patches/series index c99a496b5..0e43d9fe9 100644 --- a/debian/patches/series +++ b/debian/patches/series | |||
@@ -45,4 +45,5 @@ ssh-agent-setgid.patch | |||
45 | 45 | ||
46 | # Debian-specific configuration | 46 | # Debian-specific configuration |
47 | gnome-ssh-askpass2-icon.patch | 47 | gnome-ssh-askpass2-icon.patch |
48 | sigstop.patch | ||
48 | debian-config.patch | 49 | debian-config.patch |
diff --git a/debian/patches/sigstop.patch b/debian/patches/sigstop.patch new file mode 100644 index 000000000..42bee0739 --- /dev/null +++ b/debian/patches/sigstop.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Description: Support synchronisation with service supervisor using SIGSTOP | ||
2 | Author: Colin Watson <cjwatson@debian.org> | ||
3 | Forwarded: no | ||
4 | Last-Update: 2013-08-12 | ||
5 | |||
6 | Index: b/sshd.c | ||
7 | =================================================================== | ||
8 | --- a/sshd.c | ||
9 | +++ b/sshd.c | ||
10 | @@ -1855,6 +1855,10 @@ | ||
11 | } | ||
12 | } | ||
13 | |||
14 | + if (getenv("SSH_SIGSTOP")) | ||
15 | + /* Tell service supervisor that we are ready. */ | ||
16 | + kill(getpid(), SIGSTOP); | ||
17 | + | ||
18 | /* Accept a connection and return in a forked child */ | ||
19 | server_accept_loop(&sock_in, &sock_out, | ||
20 | &newsock, config_s); | ||
@@ -1855,6 +1855,10 @@ main(int ac, char **av) | |||
1855 | } | 1855 | } |
1856 | } | 1856 | } |
1857 | 1857 | ||
1858 | if (getenv("SSH_SIGSTOP")) | ||
1859 | /* Tell service supervisor that we are ready. */ | ||
1860 | kill(getpid(), SIGSTOP); | ||
1861 | |||
1858 | /* Accept a connection and return in a forked child */ | 1862 | /* Accept a connection and return in a forked child */ |
1859 | server_accept_loop(&sock_in, &sock_out, | 1863 | server_accept_loop(&sock_in, &sock_out, |
1860 | &newsock, config_s); | 1864 | &newsock, config_s); |