Process dies, if it is run via paramiko ssh session and with “&” in the end

后端 未结 2 448
北荒
北荒 2021-01-07 14:42

I just want to run tcpdump in background using paramiko.

Here is the part of the code:

ssh = paramiko.SSHClient()
ssh.set_missing_host_k         


        
2条回答
  •  借酒劲吻你
    2021-01-07 15:27

    just need add a sleep command,

    cmd = "(nohup tcpdump -i eth1  port 443 -w /tmp/dump20150317183305940107.pcap) &"  
    

    change to

    cmd = "(nohup tcpdump -i eth1  port 443 -w /tmp/dump20150317183305940107.pcap) &; sleep 1" 
    

提交回复
热议问题