0
本地安裝了pm2
(不作爲守護程序運行)。沒有應用程序尚未加載:pm2:無需自動啓動應用程序即可加載processes.json
$ pm2 status
┌────────────────────┬────┬─────────┬──────┬────────┬─────────┬────────┬──────────────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │
└────────────────────┴────┴─────────┴──────┴────────┴─────────┴────────┴──────────────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app
現在,假設我開始使用process.json
文件(例如here)的應用程序。在這種情況下,命令pm2 start process.json
執行以下操作:
- 加載應用程序數據,這樣PM2意識到它
- 啓動應用程序
這裏是輸出:
$ pm2 start process.json
...
$ pm2 status
┌────────────────────┬────┬─────────┬──────┬────────┬─────────┬────────┬──────────────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │
├────────────────────┼────┼─────────┼──────┼────────┼─────────┼────────┼──────────────┼──────────┤
│ hapiprocess │ 0 │ cluster │ 3749 │ online │ 1 │ 0s │ 10.090 MB │ disabled │
└────────────────────┴────┴─────────┴──────┴────────┴─────────┴────────┴──────────────┴──────────┘
但是,我想首先將應用程序數據加載到pm2中,而不自動啓動它;啓動將在稍後使用pm2 start <application-name>
完成。
無論如何要實現這一目標嗎?