Hi John,
Thank you for your answer, however it is of limited help.
The documentation to which you link is all about running pm2 on linux. At the end, there’s a footnote that mentions in a rather off-hand way some other programs you might try with limited success for windows. I have tried them, and they do not work reliably, I am not sure why or why not; but pm2 is not always running when Windows reboots on some environments.
However I don’t think it should matter. If pm2 is already running when I want to deploy, I still need to use pm2 to stop serving the old version, and start up serving the new version. That amounts to a command like “pm2 startOrReload ecosystem.config.js”, plus a couple others to ensure smooth operations.
When I RDP into the machine, I can open up a terminal, run the same command I want Octopus to execute, close the terminal, logout, and pm2 will keep serving. Whether pm2 was started by me in this way, or at boot time automatically, it is running when the deployment happens. (Although, this ought not to be a breaking requirement – I don’t expect my whole infrastructure to stop working because I forgot to start a service relevant to one application.)
Either way, running the “startOrReload” command will ensure my website is being served, but when Octopus does it, it will hang infinitely long, block all other deployments from proceeding, and require a reboot of Octopus. If I can’t run “startOrReload” from Octopus, what pm2 commands am I supposed to run in order to ensure my new deployment is served? It needs to replace the existing runtimes with new runtimes.
In order for Octopus to interoperate with pm2, it needs to be able to execute pm2 commands without hanging up. Are you saying that it can execute “startOrReload” if pm2 is already running or has been started as a Windows service? Because I don’t think that’s correct; but if I’m wrong and this can be quickly resolved I would appreciate it.
Thanks,
Sam