I am running ssh somehost "service XXX restart" and the shell hangs. 
The service is nodeJS and I see express is listening on port ... print I made in server.js and that's it, it does not return to prompt, it simply hangs. 
I tried nohup and & but it does not help. What else can I try?
turns out that using -t resolves the issue. 
ssh -t root@somehost "service XXX restart" does not hang. 
other suggestions from the comments that might resolve this:
node myScript.js & disownexec node myScript.js &If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With