From: Mathieu Desnoyers Date: Thu, 16 May 2019 19:07:56 +0000 (-0400) Subject: Improve handling of test SIGTERM/SIGINT (v2) X-Git-Tag: v2.10.8~25 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=74a6c3f57109f5924f734f66ead8ee1915a48803;hp=74a6c3f57109f5924f734f66ead8ee1915a48803;p=lttng-tools.git Improve handling of test SIGTERM/SIGINT (v2) The current state of signal handling for test scripts is: on SIGTERM/SIGINT of the tests (e.g. a CTRL-C on the console), session daemon and relay daemon are killed with SIGKILL, thus leaking all their resources, and leaving lttng kernel modules loaded. Revamp the "stop" functions to take a signal number and a timeout as optional parameters. The default signal number is SIGTERM. The full_cleanup trap handler now tries to nicely kill relayd and sessiond (if they are present) with SIGTERM, and wait up to the user-configurable LTTNG_TEST_TEARDOWN_TIMEOUT environment variable (which has a default of 60s). Then, if there are still either relayd, sessiond, or consumerd present, it will SIGKILL them and wait for them to vanish. If it had to kill sessiond with SIGKILL, it will also explicitly try to unload the lttng modules with modprobe. This approach is inspired from sysv init script shutdown behavior. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau ---