Skip to contentSkip to conversation

mkdir of /etc/.udev/rules.d/

DISCUSSION Marco d'Itri 2 participants 5 messages Nov 3, 2009 – Nov 4, 2009

lore
Share & tools
lore
#0 lore raw

udev_rules_new() in udev/udev-rules.c unconditionally creates the directory.
This is a problem because the function is called also by e.g. udevadm test, and creating /dev/.udev/ when it does not exist is an unacceptable side effect which will break everything else that checks for its existence to know if udev is running.
Why is this needed?

Signature · 2 lines
ciao,
Marco
#1 lore raw
Quoted 7 lines · Marco d'Itri

udev_rules_new() in udev/udev-rules.c unconditionally creates the directory.
This is a problem because the function is called also by e.g. udevadm test, and creating /dev/.udev/ when it does not exist is an unacceptable side effect which will break everything else that checks for its existence to know if udev is running.
Why is this needed?

No specific reason, I remember. It could move into the daemon, before the inotify watch.

Thanks,
Kay

#2 lore raw
In reply to Marco d'Itri
Quoted 9 lines · Kay Sievers
Quoted 7 lines

udev_rules_new() in udev/udev-rules.c unconditionally creates the directory.
This is a problem because the function is called also by e.g. udevadm test, and creating /dev/.udev/ when it does not exist is an unacceptable side effect which will break everything else that checks for its existence to know if udev is running.
Why is this needed?

No specific reason, I remember. It could move into the daemon, before the inotify watch.

Why create it at all?
(I suspect that this was done to suppress a warning about the missing directory, but then I'd rather do it properly with a flag...)

Signature · 2 lines
ciao,
Marco
#3 lore raw
In reply to Marco d'Itri
Quoted 9 lines · Marco d'Itri
Quoted 7 lines · Kay Sievers
Quoted 7 lines

udev_rules_new() in udev/udev-rules.c unconditionally creates the directory.
This is a problem because the function is called also by e.g. udevadm test, and creating /dev/.udev/ when it does not exist is an unacceptable side effect which will break everything else that checks for its existence to know if udev is running.
Why is this needed?

Quoted 5 lines
Quoted 2 lines

No specific reason, I remember. It could move into the daemon, before the inotify watch.

Why create it at all?
(I suspect that this was done to suppress a warning about the missing directory, but then I'd rather do it properly with a flag...)

It's to be able to subscribe to changes in that directory with inotify. We want to create it before we try to watch it, but only the daemon needs to do this.

Kay

#4 lore raw
In reply to Marco d'Itri
Quoted 12 lines · Kay Sievers
Quoted 11 lines · Marco d'Itri
Quoted 9 lines · Kay Sievers
Quoted 7 lines

udev_rules_new() in udev/udev-rules.c unconditionally creates the directory.
This is a problem because the function is called also by e.g. udevadm test, and creating /dev/.udev/ when it does not exist is an unacceptable side effect which will break everything else that checks for its existence to know if udev is running.
Why is this needed?

No specific reason, I remember. It could move into the daemon, before the inotify watch.

Quoted 7 lines
Quoted 3 lines

Why create it at all?
(I suspect that this was done to suppress a warning about the missing directory, but then I'd rather do it properly with a flag...)

It's to be able to subscribe to changes in that directory with inotify. We want to create it before we try to watch it, but only the daemon needs to do this.

I have changed this now, and only the daemon creates the directory, right before it establishes the inotify watch.

Kay