我正进入(状态
tjcw:Downloads$ grep netserver run-all-6.txt
+ netserver_pid=623321
+ netserver -p 50000 -4
Starting netserver with host 'IN(6)ADDR_ANY' port '50000' and family AF_INET
+ netserver_pid=623938
+ netserver -p 50001 -4
Starting netserver with host 'IN(6)ADDR_ANY' port '50001' and family AF_INET
+ netserver_pid=624493
+ netserver -p 50002 -4
Starting netserver with host 'IN(6)ADDR_ANY' port '50002' and family AF_INET
+ netserver_pid=624680
+ netserver -p 50003 -4
Unable to start netserver with 'IN(6)ADDR_ANY' port '50003' and family AF_INET
+ netserver_pid=624805
+ netserver -p 50004 -4
Unable to start netserver with 'IN(6)ADDR_ANY' port '50004' and family AF_INET
+ netserver_pid=624892
+ netserver -p 50005 -4
Unable to start netserver with 'IN(6)ADDR_ANY' port '50005' and family AF_INET
即 3 次正常启动,然后 3 次失败。失败消息是什么意思?我的测试用例是https://github.com/tjcw/bpf-examples/blob/tjcw-integration-1.2/AF_XDP-filter/run-all.sh 我正在使用已完全更新的 Ubuntu 22.04。
答案1
这是因为之前运行的 netserver 实例仍然存在。要以受控方式终止 netserver,必须使用以下命令启动它:
netserver -D -f &
kill
然后您可以记录它的 PID,并在需要执行该操作时终止它。