[Bug 1778833] Re: tty symlink incorrect after disconnect/reconnect, fixed by manual udevadm trigger
zach
1778833 at bugs.launchpad.net
Tue Jul 3 15:01:44 UTC 2018
For the record, this behavior disappears if I change the rule from:
SUBSYSTEMS=="usb", ATTRS{whatever}=="whatever", SYMLINK+="ttyWhatever"
to:
SUBSYSTEM=="tty", ATTRS{whatever}=="whatever", SYMLINK+="ttyWhatever"
The first rule didn't actually match the TTY device at the leaf of the
device tree. I suspect it must have been matching the cdc_acm USB device
that is one level above the TTY device in the hierarchy.
So in all likelihood, the "correct" rule is the second one, And this
rule does work the same way regardless of whether the device is
disconnected and reconnected, or `udevadm trigger` is run.
I do think the current udev behavior is still a bug, though: either the
first rule should always fail, or should always work. The fact that the
symlink works correctly with the first rule only when udevadm is
manually triggered, but not when the device is removed and re-added,
cannot be the expected behavior. (Right?)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to udev in Ubuntu.
https://bugs.launchpad.net/bugs/1778833
Title:
tty symlink incorrect after disconnect/reconnect, fixed by manual
udevadm trigger
Status in udev package in Ubuntu:
New
Bug description:
I recently upgraded from Ubuntu 17.10 to 18.04 and encountered what appears to be a regression in udev. On 17.10 (and previous), the following udev rule to rename a USB serial device worked perfectly:
SUBSYSTEMS=="usb", ATTRS{product}=="IOTool", ATTRS{manufacturer}=="zplab.wustl.edu", ATTRS{serial}=="0xFFFF", SYMLINK+="ttyIOTool"
This would yield symlinks as expected:
> ls -l /dev/ttyIOTool
lrwxrwxrwx 1 root root 7 Jun 26 21:34 /dev/ttyIOTool -> ttyACM1
On 18.04, the same symlinks are made correctly at boot time. However,
if the device is unplugged and then re-plugged, the symlink instead
goes to /dev/bus/usb:
> ls -l /dev/ttyIOTool
lrwxrwxrwx 1 root root 15 Jun 26 21:33 /dev/ttyIOTool -> bus/usb/003/013
This is a problem, because /dev/bus/usb devices can't be opened as
serial ports in the way that /dev/tty devices can.
However, manually triggering udev via `udevadm trigger` returns the
symlinks to the expected state. I am fairly certain that this behavior
represents a bug, because there shouldn't be any difference in
behavior between an auto-triggered event with a disconnect /
reconnect, and one manually triggered via udevadm trigger, right?
Version information: udevadm --version gives 237 on the 18.04 system
(with this broken behavior) and 234 on an identical 17.10 system with
the correct behavior. On a similar 16.10 system with udevadm version
231, such symlinks also work fine.
Note also that there are several reports of similar udev behavior around the web, which have left the users fairly perplexed; e.g.:
https://github.com/psi46/elComandante/issues/14
https://github.com/oskarpearson/mmeowlink/issues/52
Please let me know if there's anything further I can do to help debug
this problem. I can probably work around this by using /dev/serial/by-
id, but if anyone has other workarounds to try (different udev rules,
perhaps?), I would be grateful as well.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/udev/+bug/1778833/+subscriptions
More information about the foundations-bugs
mailing list