ssh remote command does not return

后端 未结 2 531
萌比男神i
萌比男神i 2021-01-06 08:11

I am running ssh somehost \"service XXX restart\" and the shell hangs.

The service is nodeJS and I see express is listening on port ... pr

2条回答
  •  滥情空心
    2021-01-06 08:48

    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 & disown
    • exec node myScript.js &

提交回复
热议问题