PluggedP93

Member
Dec 4, 2019
20
3
3
Canada
cPanel Access Level
Website Owner
I'm trying to have node processes run continuously. I am able to start them with pm2 through ssh from my local machine, but that automatically disconnects every morning at 00:00. How can I get pm2 to run these processes without ever shutting them down?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston

PluggedP93

Member
Dec 4, 2019
20
3
3
Canada
cPanel Access Level
Website Owner
Hi Lauren,

Thanks for the response! (And HB as well).

I'd honestly never heard of Passenger before, so I'll look into that! A colleague has also been recommending I use Docker instead, what would be your thoughts on that?

Thanks!
 

PluggedP93

Member
Dec 4, 2019
20
3
3
Canada
cPanel Access Level
Website Owner
Alright, good to know!

Looking into Passenger, I believe my initial problem may have been poorly explained. I believe that whether I use pm2, Passenger, or even Docker, the server seems to reset every night and kill every lingering process (therefore killing my website). Is there a way for me to stop the server from killing them or, if it does, make them automatically restart?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
Alright, good to know!

Looking into Passenger, I believe my initial problem may have been poorly explained. I believe that whether I use pm2, Passenger, or even Docker, the server seems to reset every night and kill every lingering process (therefore killing my website). Is there a way for me to stop the server from killing them or, if it does, make them automatically restart?
I believe the reason for the restart script I noted is because there isn't a way to keep it from killing the process.
 

PluggedP93

Member
Dec 4, 2019
20
3
3
Canada
cPanel Access Level
Website Owner
I believe the reason for the restart script I noted is because there isn't a way to keep it from killing the process.
Looking into things more, I came across this post: https://forums.cpanel.net/threads/make-nodejs-service-with-git-repos.633181/
Followed the instructions detailed in it and it worked. My pm2 is staying up. I started it yesterday afternoon and everything was still running this morning. The Daemon has been up for 17h, so there is a way to avoid the process kill.

This has however solved my problem. Thank you Lauren and your colleague HB for all the help!
 
  • Like
Reactions: cPanelLauren