Skip to content

Fix/dashboard sigint exit - #6152

Open
cuishuang wants to merge 1 commit into
Unitech:developmentfrom
cuishuang:fix/dashboard-sigint-exit
Open

Fix/dashboard sigint exit#6152
cuishuang wants to merge 1 commit into
Unitech:developmentfrom
cuishuang:fix/dashboard-sigint-exit

Conversation

@cuishuang

Copy link
Copy Markdown
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A (no issue filed)
| License       | AGPL-3.0
| Doc PR        | N/A



`pm2 dashboard` crashes when the user presses Ctrl-C.

The SIGINT handler is registered with a regular function. When the signal is emitted, `this` refers to the `process` object rather than the PM2 CLI instance. As a result, `this.Client` resolves to `process.Client`, which does not exist.



Use the already captured CLI instance, `that`, when disconnecting the PM2 bus during SIGINT handling.

This allows the dashboard to disconnect cleanly and exit with status code 0.

Signed-off-by: cuishuang <imcusg@gmail.com>
@CLAassistant

CLAassistant commented Sep 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cuishuang
cuishuang changed the base branch from master to development September 7, 2026 04:47
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