I am running ssh somehost \"service XXX restart\" and the shell hangs.
ssh somehost \"service XXX restart\"
The service is nodeJS and I see express is listening on port ... pr
express is listening on port ...
turns out that using -t resolves the issue.
-t
ssh -t root@somehost "service XXX restart" does not hang.
ssh -t root@somehost "service XXX restart"
other suggestions from the comments that might resolve this:
node myScript.js & disown
exec node myScript.js &