我正進入(狀態
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 -D -f &
kill
然後你可以記錄它的 PID 並在需要時終止它。