From 26d7b9483784f5aad446ef360c4ce3c4bea46d2d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 30 Nov 2018 21:26:58 -0800 Subject: [PATCH] Use service log feature for robust kill/terminate --- stage2/01-sys-tweaks/01-run.sh | 2 ++ stage2/01-sys-tweaks/files/camera_log_run | 2 ++ stage2/01-sys-tweaks/files/camera_run | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 stage2/01-sys-tweaks/files/camera_log_run diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 64dcab8..37cd60c 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -120,8 +120,10 @@ install -m 755 extfiles/rpiConfigServer "${ROOTFS_DIR}/usr/local/sbin/configServ install -m 755 extfiles/netconsoleTee "${ROOTFS_DIR}/usr/local/bin/" install -v -d "${ROOTFS_DIR}/service/camera" +install -v -d "${ROOTFS_DIR}/service/camera/log" install -m 755 files/camera_run "${ROOTFS_DIR}/service/camera/run" +install -m 755 files/camera_log_run "${ROOTFS_DIR}/service/camera/log/run" on_chroot << EOF cd /service/camera && rm -f supervise && ln -s /tmp/camera-supervise supervise diff --git a/stage2/01-sys-tweaks/files/camera_log_run b/stage2/01-sys-tweaks/files/camera_log_run new file mode 100755 index 0000000..1f3fa7d --- /dev/null +++ b/stage2/01-sys-tweaks/files/camera_log_run @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/local/bin/netconsoleTee -u diff --git a/stage2/01-sys-tweaks/files/camera_run b/stage2/01-sys-tweaks/files/camera_run index 5d61245..5ada463 100755 --- a/stage2/01-sys-tweaks/files/camera_run +++ b/stage2/01-sys-tweaks/files/camera_run @@ -1,4 +1,4 @@ #!/bin/sh -sleep 1 cd /home/pi -exec pgrphack /usr/local/bin/setuidgids pi ./runCamera 2>&1 | /usr/local/bin/netconsoleTee -u +exec 2>&1 +exec pgrphack /usr/local/bin/setuidgids pi ./runCamera