jsch icon indicating copy to clipboard operation
jsch copied to clipboard

Unable to run commands in background even after using nohup and '&'

Open Robby29 opened this issue 6 years ago • 3 comments
trafficstars

Hey Guys, I am making a ssh connection to a linux host where I try to run a script as a background process by using nohup and &, but the moment my connection closed the remote shell script also terminates.

Not sure why the nohup option is not working . Any idea?

Best Regards Robin

Robby29 avatar Dec 20 '18 06:12 Robby29

Hallo!

I have the same/similar issue. I'd like to exec

nohup tcpdump -i eth0.3 -w /tmp/direct.pcap > /dev/null 2>&1 &

but tcpdump is not started on target. Any idea how to solve that? Thanks!

Best regards, Sven

SvenLuebke avatar Mar 27 '19 14:03 SvenLuebke

I had the problem blocking me for couple days till I saw this one: https://stackoverflow.com/questions/3783441/process-dies-after-jsch-exits

channel.setPty(false) it seems resolve my issue

jjzz2019 avatar Apr 09 '19 19:04 jjzz2019

Hey Jody,

Thanks for the link. I believe I have tried this option before and it did not help. I will anyways give it another shot just to be sure.

Regards Robin

Robby29 avatar Apr 10 '19 06:04 Robby29