-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPM2.txt
More file actions
51 lines (30 loc) · 1.27 KB
/
PM2.txt
File metadata and controls
51 lines (30 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
* npm i -g pm2
* pm2 list
* pm2 start server.js
* pm2 start [id] // pm2 start all
* pm2 save
* pm2 delete [id] // pm2 delete all
* pm2 reload [id] // pm2 reload all
* pm2 stop [id] // pm2 stop all
* pm2 show <id|name> to get more details about an app
* pm2 flush all -> To clear all the logs
* pm2 kill -> It kills all the on going process
* To kill a specific process
pm2 stop [id]
pm2 delete [id]
pm2 save
To make the application start automatically after restarting the PC - Windows
* npm install pm2-windows-startup -g
* pm2-startup install
To make the application start automatically after restarting the PC - Linux
* pm2 startup systemd/upstart
* sudo env PATH=$PATH:/usr/bin /usr/local/lib/node_modules/pm2/bin/pm2 startup systemd -u kamrup-van3 --hp /home/kamrup-van3
* pm2 unstartup systemd
Linux commands:
-------------------------------------------
sudo apt-get install nodejs-legacy
sudo npm install pm2 -g
===============================================================================
* https://stackoverflow.com/questions/16727941/how-do-i-execute-cmd-commands-through-a-batch-file
* https://askubuntu.com/questions/972343/how-do-i-create-a-batch-file-and-run-it
* https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-a-batch-file-in-linux-608655/