dropbear: close all active clients on shutdown

Override the default shutdown action (stop) and close all processes
of dropbear

Since commit 498fe85, the stop action only closes the process
that's listening for new connections, maintaining the ones with
existing clients.
This poses a problem when restarting or shutting-down a device,
because the connections with existing SSH clients, like OpenSSH,
are not properly closed, causing them to hang.

This situation can be avoided by closing all dropbear processes when
shutting-down the system, which closes properly the connections with
current clients.

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
[Luis: Rework commit message]
Signed-off-by: Luis Araneda <luaraneda@gmail.com>

(cherry picked from commit 1e177844bc)
openwrt-18.06
Christian Schoenebeck 2018-07-11 22:36:03 -04:00 committed by John Crispin
parent c3df07ab3b
commit 8139438fc0
1 changed files with 5 additions and 0 deletions

View File

@ -148,6 +148,11 @@ service_triggers()
procd_add_validation validate_section_dropbear
}
shutdown() {
# close all open connections
killall dropbear
}
killclients()
{
local ignore=''