Skip to content

fix: fall back to POSIX ps flags on BusyBox/Alpine#16

Open
Luc0-0 wants to merge 2 commits intowebpod:mainfrom
Luc0-0:fix/busybox-ps-fallback
Open

fix: fall back to POSIX ps flags on BusyBox/Alpine#16
Luc0-0 wants to merge 2 commits intowebpod:mainfrom
Luc0-0:fix/busybox-ps-fallback

Conversation

@Luc0-0
Copy link

@Luc0-0 Luc0-0 commented Mar 26, 2026

ps -lx is procps-specific and doesn't work on BusyBox (Alpine Linux). BusyBox either ignores the flags and prints its own format, or returns empty output — both cause downstream parsing issues in @webpod/ingrid.

This adds a psFallback lookup using ps -eo pid,ppid,args (POSIX-compliant, works on BusyBox). If the primary ps -lx returns no results, it automatically retries with the fallback.

Related: google/zx#1369, webpod/ingrid#11

BusyBox ps (common on Alpine Linux) doesn't support -lx, so it
either errors out or returns its own default format that the parser
can't handle. This adds a psFallback lookup using ps -eo pid,ppid,args
which is POSIX-compliant and works on BusyBox.
@antongolub
Copy link
Member

antongolub commented Mar 27, 2026

Can we somehow pick the proper flow here? Additional condition?
const lookupFlow = IS_WIN ? IS_WIN2025_PLUS ? 'pwsh' : 'wmic' : 'ps'?

@Luc0-0
Copy link
Author

Luc0-0 commented Mar 27, 2026

Can we somehow pick the proper flow here? Additional condition? const lookupFlow = IS_WIN ? IS_WIN2025_PLUS ? 'pwsh' : 'wmic' : 'ps'?

yeah, added IS_BUSYBOX using fs.existsSync('/bin/busybox') — same pattern as IS_WIN/IS_WIN2025_PLUS, picks psFallback directly instead of retrying. no runtime overhead, just a sync file check at startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants