From f26463628b449e2549ac7ffa71032a12dedf171e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Wed, 22 Apr 2020 16:05:27 +0200 Subject: [PATCH] nodewatcher: Exit nodewatcher if subscript fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a subscript exits with an exit status != 0, its output should not be used. Because sending incomplete data sets might result in weird edge cases, the nodewatcher is terminated and the output of other subscripts is discarded. Signed-off-by: Fabian Bläse Acked-by: Adrian Schmutzler --- src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher index 8b556566..f113abd4 100755 --- a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher +++ b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher @@ -29,6 +29,10 @@ crawl() { for f in /usr/lib/nodewatcher.d/*.sh; do tmp="$($f)" + if [ $? -ne 0 ]; then + debug "Error when executing subscript $f, exiting!" + exit 1 + fi DATA="$DATA$tmp" done