Re: How to make /dev/ttyACM0 (and friends) exclusive?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 01, 2019 at 11:29:53PM -0500, Jeffrey Walton wrote:
> Hi Everyone,
> 
> I'm trying to trackdown a problem using my dialup modem. I have a
> program that opens the modem and watches caller id's. It flashes the
> hook when a telemarketer calls. It works well until...
> 
> When another program opens the modem then my program starts reading
> intermittent responses intended for the other program.
> 
> I cannot seem to open the device in exclusive mode. The current open
> is (I also tried with O_EXCL):
> 
>     int modem = open(device_path, O_RDWR | O_NOCTTY | O_SYNC);
> 
> I'm not sure if it because udev configures the device incorrectly or
> the kernel driver is configured incorrectly. Or maybe it is impossible
> to do.

This isn't a kernel thing, it is a userspace configuration issue.  Just
change the permissions of the device node such that only your one
program can open it.  Or, once you open it, change the permissions such
that no one else can open it.

Or better yet, uninstall modem manager, that's what is probably opening
up the device at random points in time :)

good luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux