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

Re: udev alzheimers



On Thu 21 May 2020 at 13:26:03 (-0400), Gene Heskett wrote:
> On Thursday 21 May 2020 12:11:42 David Wright wrote:
> > On Thu 21 May 2020 at 08:23:55 (-0400), Gene Heskett wrote:
> > > Since updating to stretch, udev has been randomly swapping ttyUSB0
> > > and ttyUSB1 and sometimes ttyUSB2 around, confusing the hell out of
> > > heyu, a trs-80-coco3, and occasionally even nut.  Nut (apc ups) is
> > > not on a usb-serial adapter, it just a usb cable but the other 2 are
> > > on individually unique FTDI adaptors.
> > >
> > > What udev persistent file, and where is it, do I edit
> >
> > To give you a concrete example, I've attached a set of files that
> > I use to generate stable mountpoints (USB sticks) and symlinks
> > (drives) in /media when I insert known sticks or DVD-burners.
> >
> > The comments in the first file explain how to find out the relevant
> > information for writing the others. It looks as if your serial numbers
> > would be a good choice to concentrate on, just like my burners.
> >
> > Note that, because I'm lazy, I treat the LABELs, UUIDs and serial
> > numbers as unique and distinct from each other, in one mixed namespace
> > (the filenames in /etc/udev/rules.d/my-mountpoints/).
> > The mountpoint or link is the contents of the file in that directory.
> > Thus a 1GB USB that I acquired 2017-04-03 with USGS inscribed on it
> > is FAT formatted with a "UUID" 2017-0403, and generates a mountpoint
> > /media/usgs1g. The DVD-burner with the serial number KZ3E2DH0440
> > generates a link /media/cdrom3, which makes it easy to distinguish
> > two identical LG Slim Portables plugged in simultaneously.
> >
> > > and chattr +i to
> > > effect a permanent cure for this apparently random device renaming?
> >
> > No. don't do that!
> >
> > > And whats the command to restart udev from a clean slate without
> > > rebooting?
> >
> > # udevadm control -R
> >
> Yet another way, thats at least 2 different ways.

That command causes udevadm to reread its rules and so on. If you
then unplug your USB plug, it will process the two events under the
new regime.

AIUI   udevadm trigger   will replay all the events without
(un)plugging anything, but that could be confusing for you, as you'll
get events for both your devices at the same time. So if all the
(un)plugging does no harm, perhaps do that, one at a time. Then
you know which is which.

> Do I dare run that as 
> root right now?

Rereading the rules will have no effect on the devices themselves,
just future events.

> Did, date of /dev/ttyUSB0 updated, heyu works but has to 
> restart the relay before I can query status, everytime, relay once 
> started should drop into the background noise and run till a reboot, not 
> exit between sessions.  This might be a separate problem though.

I don't understand any of this. I don't know what your rules are
designed to do.

Cheers,
David.


Reply to: