1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
Peter Rajnoha 3fee661028 udev+systemd: refine lvm2-pvscan@.service to better track device existence
When using ENV{SYSTEMD_WANTS}=lvm2-pvscan@... to instantiate a service
for lvmetad scan when the new PV appears in the system, the service
is started and executed. However, to track device removal, we need
to bind it (the "BindsTo" systemd directive) to a certain .device
systemd unit.

In default systemd setup, the device is tracked by it's name and
sysfs path (there's normally a sysfs path .device systemd unit for
a device and then the device name .device unit as an alias for it).
Neither of these two is useful for lvmetad update as we need to bind
it to device's <major>:<minor> pair.

The /dev/block/<major>:<minor> is the essential symlink under /dev
that exists for each block device (created by default udev rules
provided by udev directly). So let's use this as an alias for
the device's .device unit as well by means of "ENV{SYSTEMD_ALIAS}"
declaration within udev rules which systemd understands (this will
create a new alias "dev-block-<major>:<minor>.device".

Then we can easily bind the "dev-block-<major>:<minor>" device
systemd unit with instantiated lvm2-pvscan@<major>:<minor>.service.
So once the device is removed from the systemd, the
lvm-pvscan@<major>:<minor>.service executes it's ExecStop action
(which in turn notifies lvmetad about the device being gone).

This completes the udev-systemd-lvmetad interaction then.
2013-10-22 14:22:40 +02:00
autoconf Using Fedora 14's autoreconf. 2011-01-07 14:38:34 +00:00
conf release 2.02.103 2013-10-04 14:32:23 +01:00
daemons cleanup: WHATS_NEW + compiler warning about discarding const 2013-10-10 09:09:16 +02:00
doc conf: add separate 'conf' dir for config files 2013-07-02 15:22:11 +02:00
include reporting: Add devtypes command. 2013-09-18 01:09:15 +01:00
lib coverity: assigned variable not used and reassigned later 2013-10-16 15:06:43 +02:00
libdaemon libdaemon: Fix a subtle race in worker thread creation. 2013-10-10 00:34:35 +02:00
libdm libdm: fix races with udev 2013-10-17 11:57:33 +02:00
liblvm lvm2app: lvm_list_pvs_free seg. fault when no PVs 2013-08-14 15:17:39 -05:00
man pvscan: use major:minor as short form of --major and --minor arg for pvscan --cache 2013-10-22 13:52:18 +02:00
old-tests Add .gitignore files for an in-source-tree build. 2012-06-08 16:26:21 +01:00
po INSTALL rules updates 2010-04-09 21:42:48 +00:00
python python-lvm: Correct parsing arguments for integers 2013-07-26 10:24:01 -05:00
report-generators add copyright notices to new files 2010-07-28 12:20:38 +00:00
reports [REPORT-GENERATORS] cut down stylsheet.css to what we actually use 2010-07-21 10:00:38 +00:00
scripts udev+systemd: refine lvm2-pvscan@.service to better track device existence 2013-10-22 14:22:40 +02:00
test TEST: Test was trying to kill 2 devices in RAID5 instead of RAID6 2013-10-18 09:33:37 -05:00
tools pvscan: use major:minor as short form of --major and --minor arg for pvscan --cache 2013-10-22 13:52:18 +02:00
udev udev+systemd: refine lvm2-pvscan@.service to better track device existence 2013-10-22 14:22:40 +02:00
unit-tests cleanup: replace memset with struct initilization 2012-06-22 13:23:03 +02:00
.gitignore gitignore: Ignore files ending in ~ 2012-06-11 16:13:02 +01:00
aclocal.m4 Add aclocal.m4 (for pkgconfig). 2011-01-07 16:27:05 +00:00
configure udev+systemd: make pvscan --cache -aay run as systemd background job from udev 2013-10-18 11:38:49 +02:00
configure.in udev+systemd: make pvscan --cache -aay run as systemd background job from udev 2013-10-18 11:38:49 +02:00
COPYING Outline docs 2001-12-31 16:12:40 +00:00
COPYING.LIB Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
INSTALL quick review of docs 2008-11-04 17:49:22 +00:00
make.tmpl.in Makefiles: Fix CC variable override. 2013-09-16 19:57:14 +01:00
Makefile.in Makefile: add missing deps 2013-09-23 12:13:51 +02:00
README Rename git report from LVM2.git to lvm2.git. 2012-06-08 17:41:43 +01:00
VERSION post-release 2013-10-04 14:41:32 +01:00
VERSION_DM post-release 2013-10-04 14:41:32 +01:00
WHATS_NEW udev+systemd: refine lvm2-pvscan@.service to better track device existence 2013-10-22 14:22:40 +02:00
WHATS_NEW_DM libdm: fix races with udev 2013-10-17 11:57:33 +02:00

This tree contains the LVM2 and device-mapper tools and libraries.

For more information about LVM2 read the changelog in the WHATS_NEW file.
Installation instructions are in INSTALL.

There is no warranty - see COPYING and COPYING.LIB.

Tarballs are available from:
  ftp://sources.redhat.com/pub/lvm2/

The source code is stored in git:
  http://git.fedorahosted.org/git/lvm2.git
  git clone git://git.fedorahosted.org/git/lvm2.git

Mailing list for general discussion related to LVM2:
  linux-lvm@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

Mailing lists for LVM2 development, patches and commits:
  lvm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

  lvm2-commits@lists.fedorahosted.org (Read-only archive of commits)
  Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits

Mailing list for device-mapper development, including kernel patches
and multipath-tools:
  dm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel

The source code repository used until 7th June 2012 is accessible here:
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.