diff options
author | Ingela Anderton Andin <[email protected]> | 2013-11-12 16:57:29 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-11-13 10:58:20 +0100 |
commit | 32102f1e8225dada7526c9bfee6622f9026ba4cd (patch) | |
tree | 9c90ebd267322a86232ca8ddecbbbcad29d9a966 | |
parent | e6631f5a8bbf3218eaed1e973bfb42aa40902667 (diff) | |
download | otp-32102f1e8225dada7526c9bfee6622f9026ba4cd.tar.gz otp-32102f1e8225dada7526c9bfee6622f9026ba4cd.tar.bz2 otp-32102f1e8225dada7526c9bfee6622f9026ba4cd.zip |
ssh: Quicker shutdown of an ssh dameon
OTP-11339
-rw-r--r-- | lib/ssh/src/ssh_system_sup.erl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/ssh/src/ssh_system_sup.erl b/lib/ssh/src/ssh_system_sup.erl index 158a829eb0..bf3c12a988 100644 --- a/lib/ssh/src/ssh_system_sup.erl +++ b/lib/ssh/src/ssh_system_sup.erl @@ -55,13 +55,12 @@ stop_listener(Address, Port) -> Name = make_name(Address, Port), stop_acceptor(whereis(Name)). -stop_system(SysSup) -> - Name = sshd_sup:system_name(SysSup), - sshd_sup:stop_child(Name). - -stop_system(Address, Port) -> - sshd_sup:stop_child(Address, Port). +stop_system(SysSup) when is_pid(SysSup)-> + exit(SysSup, shutdown). +stop_system(Address, Port) -> + stop_system(system_supervisor(Address, Port)). + system_supervisor(Address, Port) -> Name = make_name(Address, Port), whereis(Name). @@ -121,7 +120,7 @@ restart_acceptor(Address, Port) -> %%%========================================================================= init([ServerOpts]) -> RestartStrategy = one_for_one, - MaxR = 10, + MaxR = 0, MaxT = 3600, Children = child_specs(ServerOpts), {ok, {{RestartStrategy, MaxR, MaxT}, Children}}. |