1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00
Commit Graph

18 Commits

Author SHA1 Message Date
Scott James Remnant
bb38678e3c udevadm: settle - synchronise with the udev daemon
There's still a slight race condition when using udevadm settle, if the
udev daemon has a pending inotify event but hasn't yet generated the
"change" uevent for it, the kernel and udev sequence numbers will match
and settle will exit.

Now udevadm settle will send a control message to udevd, which will
respond by sending SIGUSR1 back to the waiting udevadm settle once it
has completed the main loop iteration in which it received the control
message.

If there were no pending inotify events, this will simply wake up the
udev daemon and allow settle to continue.  If there are pending inotify
events, they are handled first in the main loop so when settle is
continued they will have been turned into uevents and the kernel
sequence number will have been incremented.

Since the inotify event is pending for udevd when the close() system
call returns (it's queued as part of the kernel handling for that system
call), and since the kernel sequence number is incremented by writing to
the uevent file (as udevd does), this solves the race.

When the settle continues, if there were pending inotify events that
udevd had not read, they are now pending uevents which settle can wait
for.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-03-12 10:02:37 +00:00
Kay Sievers
c2c24d4d3c udevadm: settle - use timeout signal, instead of loop counter 2009-03-11 15:06:14 +01:00
Kay Sievers
f1e7e36046 udevadm: add text for new options to command and man page 2009-03-07 02:32:40 +01:00
Kay Sievers
98d3d51715 udevadm: settle - add --seq-start= --seq-end=
It might be useful in some cases not to wait for "all" events.

  $ read START < /sys/kernel/uevent_seqnum
  $ (do something which may create uevents)
  $ udevadm settle --seq-start=$START
2009-03-04 23:48:53 +01:00
Kay Sievers
a402404fb2 test: add test for empty and non-existent ATTR 2009-02-05 12:40:15 +01:00
Kay Sievers
c2de781ef0 udevadm: settle - fix typo 2009-01-23 02:19:12 +01:00
Kay Sievers
b76ad2e537 udevadm: settle - allow --timeout=0 and --quiet 2008-12-08 16:48:54 +01:00
Kay Sievers
f6bb9e981a fix uninitialized variable warnings 2008-10-24 09:37:37 +02:00
Kay Sievers
033e9f8cde use no_argument, required_argument, optional_argument in longopts 2008-10-02 16:49:05 +02:00
Kay Sievers
8249e04e3e udevadm: settle - use libudev queue 2008-10-01 09:42:03 +02:00
Kay Sievers
17fcfb5972 use size definitions from libudev 2008-09-10 21:50:21 +02:00
Kay Sievers
31c1f53745 get rid of udev_sysdeps.c 2008-09-10 18:59:42 +02:00
Kay Sievers
55e9959b15 update file headers 2008-09-10 02:40:42 +02:00
Kay Sievers
d59f11e140 move udev_ctrl to libudev-private 2008-09-08 17:59:00 +02:00
Kay Sievers
7d563a17f3 use libudev code, unify logging, pass udev context around everywhere 2008-09-06 15:45:31 +02:00
Kay Sievers
60865f33a1 udevadm: move init from commands to udevadm 2008-09-04 10:34:48 +02:00
Kay Sievers
32bf83996b udevadm: rename internal functions to udevadm_* 2008-09-03 23:38:32 +02:00
Kay Sievers
e4255f1153 udevadm: rename source files 2008-09-03 23:33:06 +02:00