No network connection after killing openconnect process

General Tech Bugs & Fixes 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I use openconnect to connect to my VPN server, one strange thing I've noticed is that if I use kill or pkill command to kill a background running openconnect process then the whole Linux network will be unusable, I've to reboot the system to get it running again, but using Ctrl + C killing a foreground openconnect doesn't effect the network useability, I want to make a script to auto restart(kill and re-connect) openconnect at 12 AM every day, so I want to have the ability to terminate it with pkill command.

I wonder the difference between killing it with pkill and killing it with Ctrl + C and how to terminate the process properly in a shell script.

Thanks.

Log

root@vagrant:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=144 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 138.338/141.269/144.200/2.931 ms
root@vagrant:~# ps
  PID TTY          TIME CMD
 1397 pts/0    00:00:00 sudo
 1398 pts/0    00:00:00 bash
 1493 pts/0    00:00:00 openconnect
 1495 pts/0    00:00:00 ps
root@vagrant:~# pkill openconnect
root@vagrant:~# ping 8.8.8.8
connect: Network is unreachable

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.