From: Gregor H. <gre...@ew...> - 2025-05-23 11:37:20
|
When the sshguard script gets an SIGNAL to exit the clean_and_exit function is called which calls exit which in turn calls exit 0. This can in some cases call again clean_and_exit and causes a non-zero exit code. The sh -x output looks like this in this cases: ... + /usr/libexec/sshg-fw-nft-sets + clean_and_exit + '[' -n ] + exit + kill 0 + clean_and_exit + '[' -n ] + exit ~# echo $? 143 Disable the INT/TERM trap in clean_and_exit before exiting to allow a clean exit. Signed-off-by: Gregor Herburger <gre...@ew...> --- src/sshguard.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sshguard.in b/src/sshguard.in index bcc5e68ffc04..d4e59f85e1c4 100644 --- a/src/sshguard.in +++ b/src/sshguard.in @@ -27,6 +27,7 @@ clean_and_exit() { if [ -n "$PID_FILE" ]; then rm -f "$PID_FILE" fi + trap - INT TERM exit } -- 2.34.1 |