[Bug 1890836] Re: udev rule read but "RUN" command is not executed
Bill Yikes
1890836 at bugs.launchpad.net
Sat Aug 8 11:52:05 UTC 2020
It turns out the problem arises out of cargo cult programming on my
part. The bang in KERNEL=="sd*[!0-9]" is what I copied out of
stackexchange, and it's exactly what prevents the mount from matching.
I suspected that early on, but ruled it out because when the device
first connects it must connect as /dev/sda (as the partition table must
be read before there can be an sda1). Now I'm figuring the sda gets
replaced with sda1 before it reaches my custom rule.
In any case, the bug is not as I reported. I'm sorry this turned out to
be a non-bug and I'm sorry I wasted your time Mr. Streetman. This can
be closed.
I may open a new bug report to improve the debug output, because we
shouldn't have to work in the dark and guess about what the matching
criteria is doing.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1890836
Title:
udev rule read but "RUN" command is not executed
Status in systemd package in Ubuntu:
Invalid
Bug description:
The following was introduced as
"/etc/udev/rules.d/99-harvest_camera.rules":
ACTION=="add", KERNEL=="sd*[!0-9]", ENV{ID_FS_UUID_ENC}=="C355-A42D",
RUN+="/usr/bin/sudo -u bill /home/bill/scripts/harvest_camera.sh"
When the device is attached, it gets mounted but the harvest_camera.sh
script does not execute. The udev_log=debug parameter is set in
/etc/udev/udev.conf. Verbosity was also maximized by running "udevadm
control --log-priority=debug". After running "udevadm monitor
--environment --udev", the drive was attached. The output shows a
device being created (/dev/sda1) and the UUID in the rule matches.
But the script simply never executes. The /var/log/syslog file shows:
"
Reading rules file: /etc/udev/rules.d/99-harvest_camera.rules
Successfully forked off 'n/a' as PID 2201.
1-2.3: Worker [2201] is forced for rocessing SEQNUM=7973.
"
So the logs make it look as though the script was executed. The
script is simply a stub that does a "touch /tmp/IhaveExecuted" and a
call to zenity to give a popup announcement. But none of that happens
(no popup and no new file in /tmp/). With maximum verbosity, there is
no way to further diagnose this. Deeper detail is needed that shows
which matching criteria in the rules is being tried and what the
result is.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1890836/+subscriptions
More information about the foundations-bugs
mailing list