Skip to content

findNodeProcess compatible bosybox ps command#65

Open
nAnderYang wants to merge 1 commit intoeggjs:masterfrom
nAnderYang:master
Open

findNodeProcess compatible bosybox ps command#65
nAnderYang wants to merge 1 commit intoeggjs:masterfrom
nAnderYang:master

Conversation

@nAnderYang
Copy link
Copy Markdown

@nAnderYang nAnderYang commented Apr 8, 2026

The issue of egg-scripts stop failing to run on Alpine (Buxybox) systems.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced process detection on non-Windows systems to support additional system configurations.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d3683aa7-7aeb-49ca-9f51-d044ec8544c3

📥 Commits

Reviewing files that changed from the base of the PR and between 74605f7 and f9d7de4.

📒 Files selected for processing (1)
  • src/helper.ts

📝 Walkthrough

Walkthrough

The findNodeProcess function in src/helper.ts now dynamically selects the appropriate process-listing command on non-Windows platforms by first detecting BusyBox availability, then running either the BusyBox-compatible ps -o "pid,args" or the standard ps -wweo "pid,args" command accordingly.

Changes

Cohort / File(s) Summary
BusyBox Compatibility
src/helper.ts
Added runtime detection for BusyBox on non-Windows platforms to select appropriate ps command variant; Windows path unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Busybox bounces 'cross the shell,
ps commands work with magic spell,
One line tweaks the flow,
Process finding steal the show!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'findNodeProcess compatible bosybox ps command' clearly summarizes the main change: making findNodeProcess work with BusyBox's ps command on non-Windows platforms.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the process discovery logic in src/helper.ts to handle BusyBox environments by detecting the ps implementation and adjusting flags accordingly. Feedback suggests that the BusyBox-specific command should include -w and -A flags to ensure all processes are listed and command arguments are not truncated.

'wmic Path win32_process Where "Name = \'node.exe\'" Get CommandLine,ProcessId' :
// command, cmd are alias of args, not POSIX standard, so we use args
'ps -wweo "pid,args"';
'command -v ps >/dev/null 2>&1 && ps --help 2>&1 | grep -q BusyBox && ps -o "pid,args" || ps -wweo "pid,args"';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The ps -o "pid,args" command for BusyBox is likely insufficient for two reasons:

  1. Missing all-process flag: By default, BusyBox ps often only shows processes associated with the current terminal and user. To find background server processes (master and workers), you should use -A or -e to ensure all processes are listed.
  2. Truncation: BusyBox ps output is typically truncated to the terminal width. Adding the -w flag is necessary to ensure the full command line is captured, which is critical for the filterFn and the logic in stop.ts that relies on matching specific strings (like start-cluster) in the process arguments.

I suggest using ps -w -A -o pid,args for the BusyBox case.

Suggested change
'command -v ps >/dev/null 2>&1 && ps --help 2>&1 | grep -q BusyBox && ps -o "pid,args" || ps -wweo "pid,args"';
'command -v ps >/dev/null 2>&1 && ps --help 2>&1 | grep -q BusyBox && ps -w -A -o pid,args || ps -wweo "pid,args"';

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alpine(buxybox) the ps command does not include the -w and -A parameter.

@nAnderYang
Copy link
Copy Markdown
Author

#64

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.

1 participant