I am looking for a reliable solution to do package capture for test automation.
Right now, tcpdump has been used with the following command.
sudo tcpdump -i ens160 -w filename.pcap -G 60 -W 1
I stop tcpdump with:
kill -s SIGINT <pid>
1 out of 20 time tcpdump fails to exit properly, and the pcap file will be damaged.
Is there any way to make sure tcpdump will exit properly?
killcommand? The tcpdump command will terminate gracefully after a maximum of one minute anyhow, with a complete and not corrupted pcap file. – Doug Smythies Dec 12 '18 at 15:45