Unitech / Unitech/pm2

[question] run pm2 god process in foreground on windows

Open
#5,140 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

When I start the selenium service with the following nodejs code, it works well,

const cp = require('child_process');
cp.spawn('java', ['-jar', 'selenium-server.jar', 'standalone']);

But if I start the service with pm2,

pm2.start({
        script: `java`,
        args: ['-jar','selenium-server.jar', 'standalone'],
        name: 'selenium-standalone',
}, ...)

The service start successfully, but it will fail on opening Chrome browsers.

Windows seems to have a lot of strict when you need to interact with the GUI app. I think this problem have something to do with the pm2 god process, which is running in background (or use some special mode?) and have no permission to interact with GUI.

Is there anyway to run the pm2 god process (not its children) in foreground so that this problem can be workaround?
Thank you.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the direct child_process.spawn example with the pm2.start configuration in the issue, focusing on how the Selenium Java process is launched on Windows. Determine whether the reported Chrome-launch failure is caused by the PM2 god process context and whether foreground execution is supported; document the confirmed behavior and workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript, node.js, typescript
Domain
cli, operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.