From f537b30c86b4899c2d7759c8c9001708d2605752 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 1 Dec 2021 08:30:46 +0100 Subject: [PATCH] init.d-posix: exit on error This fixes a case where the px4 startup is not stopped when the px4 process is killled using -SIGKILL against the px4 deamon. In that case, the currently executing command/client is killed and properly shutting down with result -1, however, the next command is started anyway. This means that the next time we try to run the simulation we get a "PX4 daemon already running for instance 0" error and PX4 doesn't start properly. By adding exit on error, we properly exit in the case where the startup script gets stopped/killed. --- ROMFS/px4fmu_common/init.d-posix/rcS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 2ac5af5da3..1bea1b9839 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -1,5 +1,7 @@ #!/bin/sh +set -e + # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) # shellcheck disable=SC1091