I have multiple serial ports to each of which devices are connected. They are listed as /dev/ttyUSB*
. Now, I need to make sure using a python script that no other process is using any of these before I run a kermit
script (so that access is not denied) login_init
. I tried ps
and lsof
commands. lsof
gave the following output:
sof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
login_ini 13395 user4 4u CHR 188,9 0t0 512 /dev/ttyUSB9
python 14410 user4 6u CHR 188,9 0t0 512 /dev/ttyUSB9
I got the pid
s of the processes alright, but when I give the killall
command, it says no process found as follows:
user4@user-pc-4:~/Scripts$ killall -9 13395
13395: no process found
user4@user-pc-4:~/Scripts$ killall -9 14410
13395: no process found
Is this the right and the only way or there are better ways to do it?