Unitech / Unitech/pm2

Feature request: Hook that runs after (re)starting an app

Open
#5,705 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

For many use cases, it would be awesome to have a hook which is executed after an app is (re)started, which could do all kinds of tasks.

My specific use-case is to retrieve relevant secrets from a vault system and injecting them the booting app. By doing this in a hook which runs within the PM2 God module process space, and applying some additional tricks, a setup can be constructed where PM2 plays the role of 'trusted intermediate': It will be the only entity in the system with access to the Vault system and deliver appropriate secrets to appropriate apps.

Other possible use-cases could be integration with a service-discovery system, service health monitoring, and many more

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

The issue names no files, tests, or entry points. Start by locating PM2's application restart lifecycle and existing hook mechanisms, then define the hook's timing, process context, and secret-delivery behavior before implementation; done means a specified post-restart hook works reliably for the described use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.