Skip to content

Commit 0219e17

Browse files
fix: handle launchctl bootout permission errors in ensure-container-stopped.sh Co-authored-by: Renish Avaiya <renishpatel2482001@gmail.com>
Co-authored-by: Shilpan Shah <Shilpan97@gmail.com>
1 parent 48f380e commit 0219e17

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/ensure-container-stopped.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ done
4444
if $ALL_DOMAINS; then
4545
uid=$(id -u)
4646
for domain in "gui/$uid" "user/$uid" "system"; do
47+
if [ "$domain" = "system" ] && [ "$uid" -ne 0 ]; then
48+
continue
49+
fi
4750
launchctl print "$domain" 2>/dev/null \
4851
| grep -oE 'com\.apple\.container\.[^ ]+' \
4952
| sort -u \
5053
| while read -r service; do
51-
launchctl bootout "$domain/$service"
54+
launchctl bootout "$domain/$service" 2>/dev/null || true
5255
done
5356
done
5457
else

0 commit comments

Comments
 (0)