Jenkins hangs after executing SSH Command

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Jenkins hangs after executing SSH Command


I have a Jenkins job which is supposed to execute a command after uploading to the webserver. It's a simple script which kills the current npm process, writes the date to a file and restarts the server. 

kill $(ps faux | grep server.js | grep node | cut -f2 -d' ')
cd /var/www/chatbot
date >> chatbot.log
nohup npm start &

When I execute it as user www-data on the console everything works fine. Unfortunately this is not the case when running from Jenkins. Jenkins executes the command, receives the following output and then stalls 
until I kill the build manually. How can I force Jenkins to disconnect and consider the build a success after executing server-neustart?

SSH: EXEC: STDOUT/STDERR from command [/usr/local/bin/server-neustart] ...
> NetFed-Chatbot@0.1.1 start /var/www/chatbot
> node server.js

Yours Sincerely

You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit
For more options, visit