@@ -4124,9 +4124,27 @@ pub struct RuntimeStatus {
41244124/// Detect Wolf ecosystem services (and web servers) running inside a container.
41254125/// Returns a list of services found with their running status.
41264126fn detect_container_services(runtime: &str, name: &str) -> Vec<ContainerService> {
4127- let script = r#"for s in wolfproxy wolfserve wolfdisk wolfscale nginx apache2 httpd; do
4127+ // Running-check must work on MINIMAL images too. Many app containers
4128+ // (e.g. aonsoku: Alpine/BusyBox running nginx as PID 1 with `daemon off`)
4129+ // have neither systemd nor pgrep, so a `systemctl is-active || pgrep`
4130+ // check falsely reported the service as stopped even though `ps` clearly
4131+ // showed it running (KO4BSR, Jul 2026). Fall back to scanning
4132+ // /proc/<pid>/comm, which needs no extra tooling and matches the kernel's
4133+ // process name — nginx keeps comm "nginx" even though its setproctitle
4134+ // rewrites the cmdline to "nginx: master process ...".
4135+ let script = r#"is_running() {
4136+ systemctl is-active --quiet "$1" 2>/dev/null && return 0
4137+ if command -v pgrep >/dev/null 2>&1; then pgrep -x "$1" >/dev/null 2>&1 && return 0; fi
4138+ for c in /proc/[0-9]*/comm; do
4139+ [ -r "$c" ] || continue
4140+ read cn < "$c" 2>/dev/null || continue
4141+ [ "$cn" = "$1" ] && return 0
4142+ done
4143+ return 1
4144+ }
4145+ for s in wolfproxy wolfserve wolfdisk wolfscale nginx apache2 httpd; do
41284146if command -v "$s" >/dev/null 2>&1 || [ -f "/etc/systemd/system/${s}.service" ] || [ -f "/usr/lib/systemd/system/${s}.service" ]; then
4129- if systemctl is-active --quiet "$s" 2>/dev/null || pgrep -x "$s" >/dev/null 2>&1 ; then
4147+ if is_running "$s"; then
41304148echo "${s}:running"
41314149else
41324150echo "${s}:stopped"
0 commit comments