From bf47583efe59fe558eec102a1d9431a50e96b34d Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 29 Aug 2026 05:18:52 +0000 Subject: [PATCH] fix(sandbox-doctor): missing /dev/shm no longer aborts the doctor under set -eu Co-Authored-By: Claude Fable 5 --- scripts/sandbox-doctor.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/sandbox-doctor.sh b/scripts/sandbox-doctor.sh index c96c40e08..846dae64f 100755 --- a/scripts/sandbox-doctor.sh +++ b/scripts/sandbox-doctor.sh @@ -42,8 +42,10 @@ if [ ! -e /dev/fd ]; then say 'restored /dev/fd -> /proc/self/fd' fi -# 2. /dev/shm size -if [ "$(df -k /dev/shm 2>/dev/null | awk 'NR==2 {print $2}')" -lt 1048576 ]; then +# 2. /dev/shm size (missing /dev/shm => empty df output => skip, don't abort: +# an empty operand would be a test(1) error, fatal under set -eu) +shm_kb="$(df -k /dev/shm 2>/dev/null | awk 'NR==2 {print $2}')" +if [ "${shm_kb:-0}" -gt 0 ] && [ "$shm_kb" -lt 1048576 ]; then sudo mount -o remount,size=4G /dev/shm say 'remounted /dev/shm at 4G' fi