From 96c620fcf383faffb16c89c2ddd9b0857de6dfbb Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 16 Oct 2017 17:36:51 +0200 Subject: [PATCH 1/1] run: Wait for children to die. When the select loop returns and dss is about to terminate, it sends SIGTERM to any running rm or rsync processes and exits. It does not wait for these processes to die, however. This is trivial to implement, and it makes life easier for shutdown scripts which like to proceed with unmounting file systems. --- dss.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dss.c b/dss.c index 3e626ab..e9bd56a 100644 --- a/dss.c +++ b/dss.c @@ -1565,6 +1565,8 @@ static int com_run(void) ret = -E_BUG; kill_children(); exit_hook(ret); + while (wait(NULL) >= 0 || errno != ECHILD) + ; /* still have children to wait for */ return ret; } EXPORT_CMD_HANDLER(run); -- 2.39.2