Multi-user support for PM2 daemon on Windows
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
Currently, PM2 lacks support for multiple users on Windows. This is due to the IPC pipe names being hardcoded in:
https://github.com/Unitech/pm2/blob/5e708459aca32903fd363230e24c37b3e38bb48d/paths.js#L82-L88
How could we reproduce this issue?
Run PM2 as two different users on Windows.
Supporting information
Operating system: Microsoft Windows Server 2012.
$ pm2 report
connect EPERM //./pipe/rpc.sock
[PM2] Spawning PM2 daemon with pm2_home=C:\Users\user\.pm2
node:events:491
throw er; // Unhandled 'error' event
^
Error: connect EPERM //./pipe/rpc.sock
at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)
Emitted 'error' event on ReqSocket instance at:
at Socket.<anonymous> (C:\Program Files\nodejs\node_modules\pm2\node_modules\pm2-axon\lib\sockets\sock.js:201:49)
at Socket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4048,
code: 'EPERM',
syscall: 'connect',
address: '//./pipe/rpc.sock'
}
Node.js v18.12.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with paths.js lines 82-88, where the Windows IPC pipe names are hardcoded, and inspect how the PM2 daemon and clients derive those names. Reproduce the failure by running PM2 as two Windows users; done means both users can run and connect to their own PM2 daemons without the EPERM pipe error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100