From 78de13156d7be43c2592d0601bd6032de1db4544 Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Sun, 17 May 2026 18:01:35 +0200 Subject: [PATCH 1/2] fix(scanRear): guard kill against missing or stale scan_pid The unconditional `kill -9 "$(cat scan_pid)"; rm scan_pid` aborts with "No such file or directory" and "kill: '': not a pid or valid job spec" when the front-side conversion has already completed and cleaned up its tmp_dir (which contained scan_pid). Wrap the kill in existence and liveness checks so a duplex back-scan triggered after the front pipeline finished does not error out. Co-Authored-By: Claude Opus 4.7 --- script/scanRear.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/scanRear.sh b/script/scanRear.sh index 3fa0180..e1eb031 100755 --- a/script/scanRear.sh +++ b/script/scanRear.sh @@ -30,8 +30,13 @@ output_pdf_file="/scans/${date}.pdf" cd "$tmp_dir" -kill -9 "$(cat scan_pid)" -rm scan_pid +if [ -f scan_pid ]; then + pid=$(cat scan_pid) + if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then + kill -9 "$pid" + fi + rm -f scan_pid +fi function scan_cmd() { # `brother4:net1;dev0` device name gets passed to scanimage, which it refuses as an invalid device name for some reason. From 05a1dbd41481a0e7a3c3d9508a01435957c896f5 Mon Sep 17 00:00:00 2001 From: PhilippMundhenk Date: Sun, 17 May 2026 11:30:49 +0200 Subject: [PATCH 2/2] added new version of skey tool --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 84d95a2..6d30185 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ apt-get -y --no-install-recommends install \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* && \ wget https://download.brother.com/welcome/dlf105200/brscan4-0.4.11-1.amd64.deb --progress=dot:giga -O /tmp/brscan4.deb && \ -wget https://download.brother.com/welcome/dlf006652/brscan-skey-0.3.2-0.amd64.deb --progress=dot:giga -O /tmp/brscan-skey.deb && \ +wget https://download.brother.com/welcome/dlf006652/brscan-skey-0.3.5-0.amd64.deb --progress=dot:giga -O /tmp/brscan-skey.deb && \ dpkg -i --force-all /tmp/brscan4.deb && \ dpkg -i --force-all /tmp/brscan-skey.deb && \ rm -f /tmp/brscan4.deb /tmp/brscan-skey.deb