开发者

Get pid who comunnicate over COM1

Can I 开发者_JAVA技巧see PID who uses COM1 in Debian from start os and if can how ? Is there any log file for this ?


The simple way is to simply:

$ fuser /dev/ttyS0

Note that this will only show processes from your own user, unless you're root.

The kernel does not directly log when processes open the serial port. There are a number of options if you need to log:

  1. Periodically log the output of fuser /dev/ttyS0 or lsof /dev/ttyS0.
  2. Restrict access to /dev/ttyS0 to a special-purpose user, and use sudo or some other gateway program to gain access to it. This will leave logs when the gateway program is invoked.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜