Re: udev remove event not sent untill the device is closed

From: Thomas Stewart
Date: Sat Oct 02 2004 - 10:36:35 EST


On Friday 01 October 2004 18:53, you wrote:
> On Mon, Sep 27, 2004 at 10:52:36PM +0100, Thomas Stewart wrote:
> > However, if I attach the device, open it with say a "cat /dev/ttyUSB0"
> > and then remove the device. No tty events get sent untill I kill the cat.
>
> This is because the tty device remains until the last userspace process
> releases the device. You might want to trigger your script off of the
> removal of the USB device instead.

I tried that method instead and it works. Now that I think about it more it
does make more sense.

For anyone else doing something similar this is what I ended up with
http://www.stewarts.org.uk/stuff/ttyUSB.hotplug not exactly elegant but it
works.

Thanks
--
Tom

PGP Fingerprint [DCCD 7DCB A74A 3E3B 60D5 DF4C FC1D 1ECA 68A7 0C48]
PGP Publickey [http://www.stewarts.org.uk/public-key.asc]
PGP ID [0x68A70C48]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/