#StackBounty: #root #devices #modem Why root user is not getting "Device or resource busy" response?

Bounty: 50

I am working with GSM modem and using /dev/ttyUSB2 device.

Device is having proper rights:

$ ls -alh /dev/ttyUSB2
crw-rw---- 1 root dialout 188, 2 May 25 19:44 /dev/ttyUSB2

I am in dialout group and I can send AT command to this modem only once. After sending “ATD” command (echo -e -n "ATD ...;r" > /dev/ttyUSB2), according to lsof /dev/ttyUSB2 process ModemManager opens this very file and if I send another AT command I get message:

bash: /dev/ttyUSB2: Device or resource busy

OK, so for some reason ModemManager is holding this file busy, but when this happens I can still send commands the same way, but from root user.

I’ve got two questions:

  1. Why root user can override this “Device or resource busy” lock?
  2. What rights / other settings regular user should have to bypass it like root user.

Get this bounty!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.