1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00
lvm2/scripts
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
..
lvm2create_initrd Add .gitignore files for an in-source-tree build. 2012-06-08 16:26:21 +01:00
.gitignore More .gitignore files for an in-source-tree build. 2012-06-08 16:34:43 +01:00
blk_availability_init_red_hat.in scripts: blk-availability - use full name for clarity 2012-10-15 16:10:58 +02:00
blk_availability_systemd_red_hat.service.in scripts: blk-availability should be stopped before FCoE 2012-10-15 15:00:12 +02:00
blkdeactivate.sh.in blkdeactivate: add support for bind mounts 2013-08-13 17:51:40 +02:00
clvmd_fix_conf.sh Use /bin/bash for scripts with bashisms 2010-05-14 11:33:20 +00:00
clvmd_init_red_hat.in initscripts: add pidfile reference in chkconfig header for clvmd and cmirrord 2013-06-07 14:07:56 +02:00
cmirrord_init_red_hat.in initscripts: add pidfile reference in chkconfig header for clvmd and cmirrord 2013-06-07 14:07:56 +02:00
dm_event_systemd_red_hat.service.in systemd: Add Documentation references 2012-06-20 14:23:50 +02:00
dm_event_systemd_red_hat.socket.in systemd: add doc reference in dm-event.socket 2012-06-29 13:54:35 +02:00
fsadm.sh locales: use higher prio LC_ALL variable 2013-01-22 11:25:02 +01:00
gdbinit RAID: Add writemostly/writebehind support for RAID1 2013-04-15 13:59:46 -05:00
lvm2_activation_generator_systemd_red_hat.c systemd: run lvm2-activation-net.service after lvm2-activation.service 2013-09-16 11:47:09 +02:00
lvm2_lvmetad_init_red_hat.in Remove pvscan --cache from lvm2-lvmetad init script. 2012-10-15 12:58:23 +02:00
lvm2_lvmetad_systemd_red_hat.service.in systemd: remove ExecStartPost from lvm2-lvmetad.service. 2012-10-08 16:49:54 +02:00
lvm2_lvmetad_systemd_red_hat.socket.in systemd: Add Documentation references 2012-06-20 14:23:50 +02:00
lvm2_monitoring_init_red_hat.in Use also normalized output for vgchange command in lvm2-monitor init script. 2011-12-16 11:42:56 +00:00
lvm2_monitoring_init_rhel4 Use also normalized output for vgchange command in lvm2-monitor init script. 2011-12-16 11:42:56 +00:00
lvm2_monitoring_systemd_red_hat.service.in systemd: remove quotes in lvm2-monitor.service ExecStop 2012-11-02 20:32:28 +01:00
lvm2_pvscan_systemd_red_hat@.service.in udev+systemd: refine lvm2-pvscan@.service to better track device existence 2013-10-22 14:22:40 +02:00
lvm2_tmpfiles_red_hat.conf.in Use 'd' instead of 'D' in tmpfiles configuration to not overwrite any existing directory. 2012-02-23 14:24:30 +00:00
lvmconf_lockingtype2.sh Use /bin/bash for scripts with bashisms 2010-05-14 11:33:20 +00:00
lvmconf.sh lvmconf: use_lvmetad=0 on --enable-cluster, reset to default on --disable-cluster 2013-09-24 14:03:42 +02:00
lvmdump.sh lvmdump: Add -l, to collect a state dump from lvmetad. 2012-10-11 22:42:20 +02:00
Makefile.in udev+systemd: make pvscan --cache -aay run as systemd background job from udev 2013-10-18 11:38:49 +02:00
relpath.awk Fix scripts/relpath.awk to work with mawk 2010-05-21 15:28:16 +00:00
vg_convert change two files in different directories 2006-06-06 17:44:11 +00:00
vgimportclone.sh vgimportclone: remove 2>/dev/null from three lvm commands 2013-10-21 18:04:14 -04:00
VolumeGroup.ocf Add OCF support 2010-11-05 16:18:38 +00:00