diff options
author | Colin Watson <cjwatson@debian.org> | 2014-02-09 16:10:17 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2014-10-07 14:27:21 +0100 |
commit | 689f465c66059e527974c6d4ea8e95f04d5abab7 (patch) | |
tree | 7171c481181e3715e9c73b57108d8768aefe8500 /sshd.c | |
parent | 1195b028cb9f402633cfdcae6ec34bf63b4ab771 (diff) |
Support synchronisation with service supervisor using SIGSTOP
Author: Robie Basak <robie.basak@ubuntu.com>
Forwarded: no
Last-Update: 2014-04-14
Patch-Name: sigstop.patch
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1958,6 +1958,16 @@ main(int ac, char **av) | |||
1958 | } | 1958 | } |
1959 | } | 1959 | } |
1960 | 1960 | ||
1961 | if (getenv("SSH_SIGSTOP")) { | ||
1962 | /* Tell service supervisor that we are ready. */ | ||
1963 | kill(getpid(), SIGSTOP); | ||
1964 | /* The service supervisor only ever expects a single | ||
1965 | * STOP signal, so do not ever signal it again, even | ||
1966 | * in the case of a re-exec or future children. | ||
1967 | */ | ||
1968 | unsetenv("SSH_SIGSTOP"); | ||
1969 | } | ||
1970 | |||
1961 | /* Accept a connection and return in a forked child */ | 1971 | /* Accept a connection and return in a forked child */ |
1962 | server_accept_loop(&sock_in, &sock_out, | 1972 | server_accept_loop(&sock_in, &sock_out, |
1963 | &newsock, config_s); | 1973 | &newsock, config_s); |