Exercise 2: PM2 Restarting a Crashed Process — Possible Solution ==================================================================== SETUP ------------------------------ pm2 start ./dist/server/entry.mjs --name website-astro pm2 save CONFIRMATION ------------------------------ pm2 list shows website-astro running with a real process ID (PID). Finding that PID and killing it directly, bypassing PM2 entirely: kill -9 Running pm2 list again immediately afterward shows website-astro still present, now with a new PID and its own restart count incremented by one - PM2 detected the process died and started a fresh instance automatically, with no manual intervention. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly starts the server under PM2's own supervision, correctly simulates a genuine crash by killing the process directly rather than stopping it through PM2, and correctly confirms PM2's own automatic restart behavior by observing the incremented restart count and new PID.