When deploying from CI, as the user who started PM2, pm2 restart appname
always results in [PM2][ERROR] Process or Namespace appname not found
whoami/who on deployment shows the correct user.
Tried switching users, as well as PM2's location:
/usr/local/bin/pm2 restart appname
results in the same process not found.
CI command:
script:
- pm2 restart appname
or:
deploy: 'ssh -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_IP "pm2 restart appname"'
script:
- "eval $deploy"