Sugeng rawuh

Auto run node js if reboot system


Image : list pm2 , check after reboot system 

Auto run node js if reboot system

1. Install PM2 globally using NPM

npm install pm2 -g


2.Start your script with pm2

pm2 start app.js


3. generate an active startup script

pm2 startup


NOTE: pm2 startup is for startting the PM2 when the system reboots. PM2 once started, restarts all the processes it had been managing before the system went down. In case you want to disable the automatic startup, simply use pm2 unstartup If you want the startup script to be executed under another user, just use the -u <username> option and the --hp <user_home>:




Share:

0 comments:

Post a Comment

Tonton video



Yuk, SUBSCRIBE

omfiki.blogspot.com