I am using socat
version 1.7.3.2 to create a character device from a VLAN Ethernet device for communication. I create the device using following command:
socat INTERFACE:wwan0.vlan_dev1,type=2 PTY,mode=0777,rawer,link="/dev/ser_vlan0" &
It creates files as:
/dev/ser_vlan0 -> /dev/pts/22
Even after the wwan0
device is removed, the files /dev/ser_vlan0
and /dev/pts/22
still exist.
Is there a way to remove these files automatically when wwan0
no longer exists?