I'm running a shell command at the end of a Jenkins deployment to restart a forever script:
npm install && forever stop app.js && forever start -a -l /var/log/forever.log app.js
When I run that as a user jenkins everything works fine and the console output from the build history also tells me that the forever script is running. However, the process stops right after the deployment is finished and the forever process is stopped.
What causes this behavior and how can I fix it?