1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-25 01:34:38 +03:00
lvm2/udev
Martin Wilck 7a7b8a7778 udev: keep systemd vars on change event in 69-dm-lvm-metad.rules for systemd reload
The current logic that avoids setting SYSTEMD_ALIAS and SYSTEMD_WANTS
on "change" events is flawed in the default "systemd background job"
configuration. For systemd, it's important that device properties don't
change spuriously.

If an "add" event starts lvm2-pvscan@.service for a device, and a
"change" event follows, removing SYSTEMD_ALIAS and SYSTEMD_WANTS from the
udev db, information about unit dependencies between the device and the
pvscan service can be lost in systemd, in particular if the daemon
configuration is reloaded.

Steps to reproduce problem:

- create a device with an LVM PV
- remove device
- add device (generates "add" and "change" uevents for the device)
  (at this point SYSTEMD_ALIAS and SYSTEMD_WANTS are clear in udev db)
- systemctl daemon-reload
  (systemd reloads udev db)
- vgchange -a n
- remove device

=> the lvm2-pvscan@.service for the device is still active although the
device is gone.

- add device again

=> the PV is not detected, because systemd sees the lvm2-pvscan@.service
as active and thus doesn't restart it.

The original purpose of this logic was to avoid volumes being scanned
over and over again. With systemd background jobs, that isn't necessary,
because systemd will not restart the job as long as it's active.

Signed-off-by: Martin Wilck <mwilck@suse.com>
2018-04-17 11:38:12 +02:00
..
.gitignore gitignore: Update for in-place build. 2015-07-27 13:18:35 +01:00
10-dm.rules.in udev: rules: add comments explaining subsystem-specific rules 2016-04-26 12:57:37 +02:00
11-dm-lvm.rules.in udev: clear temporary variable properly 2014-01-20 12:54:10 +01:00
12-dm-permissions.rules add copyright lines 2009-10-26 22:42:07 +00:00
13-dm-disk.rules.in udev: also create /dev/disk/by-part{label,uuid} and gpt-auto-root symlinks 2017-07-10 12:36:39 +02:00
69-dm-lvm-metad.rules.in udev: keep systemd vars on change event in 69-dm-lvm-metad.rules for systemd reload 2018-04-17 11:38:12 +02:00
95-dm-notify.rules.in udev: udev rules cleanup 2012-06-27 12:11:56 +02:00
Makefile.in udev: keep systemd vars on change event in 69-dm-lvm-metad.rules for systemd reload 2018-04-17 11:38:12 +02:00