librelad 22364f5421 fix(rootless): enumerate containers/ as its owner, not the manager
Bare `find "$containers_dir"` runs as the manager, but under rootless
containers/ is dockerinstall-owned 751 (traversable, not list-readable by
the manager) -> "find: /docker/containers/: Permission denied". For the
app-log generator that was cosmetic; for dockerComposeUpAllApps /
dockerComposeDownAllApps it silently enumerates nothing so no apps come
up/down. Route these through runFileOp find (dockerinstall in rootless,
manager in rooted — correct in both). The two docker-type switcher finds
are deliberately left: mid-switch the at-rest container owner can differ
from the target-mode user runFileOp resolves to, so they need mode-aware
handling rather than a blind swap.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-24 21:46:17 +01:00

16 lines
538 B
Bash
Executable File

#!/bin/bash
dockerComposeDownAllApps()
{
local type="$1"
# runFileOp: containers/ is owned by the container user (dockerinstall, 751)
# under rootless and isn't list-readable by the manager — enumerate as the
# owner or this silently finds nothing and no apps get brought down.
local subdirectories=($(runFileOp find "$containers_dir" -mindepth 1 -maxdepth 1 -type d))
for dir in "${subdirectories[@]}"; do
local app_name=$(basename "$dir")
dockerComposeDown "$app_name" "" "$type"
done
}