1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/tools
David Teigland a7de7a7bc0 add activation services
New systemd services for startup:

lvm-devices-wait.service
  Used in place of systemd-udev-settle, this service waits
  for udev+pvscan to process PVs listed in system.devices.
  It runs the command "lvmdevices --wait pvsonline".
  This only waits for PVs that can be matched to a device in
  sysfs, so it only waits for devices attached to the system.
  It waits specifically for the /run/lvm/pvs_online/<pvid>
  files to be created by pvscan.  It quits waiting after a
  configurable number of seconds.  This service gives the
  first activation service a chance to activate VGs from
  PVs that are available immediately at startup.  If this
  service quits waiting before all the expected pvid files
  appear, then the VG associated with those PVs will most
  likely be activated by the -last service rather than the
  initial -main service.  If those PVs are even slower to
  complete processing than the -last service, then the VG
  will be activated by event activation whenever they are
  finally complete.

lvm-activate-vgs-main.service
  Calls "vgchange -aay", after lvm-devices-wait, to activate
  complete VGs.  It only considers PVs that have been
  processed by udev+pvscan and have pvs_online files.
  This is expected to activate VGs from basic devices
  (not virtual device types) that are present at startup.

lvm-activate-vgs-last.service
  Calls "vgchange -aay", after multipathd has started, to
  activate VGs that became available after virtual device
  services were started, e.g. VGs on multipath devices.
  Like -main, it only looks at PVs that have been processed
  by pvscan.

This vgchange in the -last service enables event activation
by creating the /run/lvm/event-activation-on file.  Event
activation will activate any further VGs that appear on the
system (or complete udev processing) after the -last service.
In the case of event activation, the udev rule will run
vgchange -aay <vgname> via a transient service
lvm-activate-<vgname>.service.  This vgchange only scans
PVs in the VG being activated, also based on the pvs_online
files from pvscan.

When there are many VGs that need activation during system
startup, the two fixed services can activate them all much
faster than activating each VG individually via events.

lvm.conf auto_activation_settings can be used to configure
the behavior (default ["service_and_event", "pvscan_hints"]).

"service_and_event" - the behavior described above, where
activation services are used first, and event activation
is used afterward.

"service_only" - only lvm-activate-vgs-* are used, and
no event-based activation occurs after the services finish.
(Equivalent to setting lvm.conf event_activation=0.)

"event_only" - the lvm-activate-vgs* services are skipped,
and all VGs are activated individually with event-based
activation.

"pvscan_hints" - the vgchange autoactivation commands
use pvs_online files created by pvscan.  This optimization
limits the devices scanned by the vgchange command to only
PVs that have been processed by pvscan.
2021-10-29 16:29:42 -05:00
..
.exported_symbols generate liblvm2cmd exported symbols too 2010-06-25 18:23:10 +00:00
.gitignore tools: add generated headers to .gitignore 2017-03-10 13:13:41 +00:00
args.h add activation services 2021-10-29 16:29:42 -05:00
cmdnames.h doc: change fsf address 2016-01-21 12:11:37 +01:00
command-lines.in add activation services 2021-10-29 16:29:42 -05:00
command.c cov: add explicit NULL pointer check 2021-09-20 14:26:09 +02:00
command.h commands: use AUTOTYPE in definitions 2021-04-21 08:41:37 -05:00
commands.h devices file: limit warnings about devices file entries not found 2021-08-05 13:20:26 -05:00
dumpconfig.c lvmconfig: Add options to produce file preamble 2017-08-05 16:23:34 +01:00
errors.h tools: Introduce exit code EINIT_FAILED. 2017-07-26 23:18:03 +01:00
formats.c doc: change fsf address 2016-01-21 12:11:37 +01:00
license.inc pre-release 2017-03-28 16:11:35 +01:00
lv_props.h Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
lv_types.h Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
lvchange.c lvchange: fix lvchange refresh failed for dm suspend or resume failed 2021-08-16 09:45:40 -05:00
lvconvert_poll.c thin: ignore parallel merge while polling 2021-03-18 18:34:57 +01:00
lvconvert_poll.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvconvert.c cov; matching enum type 2021-09-27 18:56:14 +02:00
lvcreate.c cleanup: use first parameter uint 2021-09-27 18:56:14 +02:00
lvdisplay.c process_each_lv: add check_single_lv function 2017-02-13 08:20:10 -06:00
lvextend.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmd-static.c lvmcmdlib: lvm2_init_threaded 2020-10-20 22:22:52 +02:00
lvm2cmd.c lvmcmdlib: lvm2_init_threaded 2020-10-20 22:22:52 +02:00
lvm2cmd.h lvmcmdlib: lvm2_init_threaded 2020-10-20 22:22:52 +02:00
lvm2cmdline.h lvmcmdlib: lvm2_init_threaded 2020-10-20 22:22:52 +02:00
lvm-static.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm.c cov: ignoring 2021-09-27 18:56:14 +02:00
lvmcmdlib.c cmdlib_lvm2_init: release cmd on failure path 2021-09-13 12:34:41 +02:00
lvmcmdline.c hints: new pvs_online type 2021-10-29 15:55:48 -05:00
lvmdevices.c add activation services 2021-10-29 16:29:42 -05:00
lvmdiskscan.c remove unused full filter 2018-12-04 14:06:46 -06:00
lvpoll.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvreduce.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvremove.c process_each_lv: add check_single_lv function 2017-02-13 08:20:10 -06:00
lvrename.c toollib: make it possible to also process internal VGs, add 'include_internal' switch to process_each_vg fn 2016-06-20 11:33:42 +02:00
lvresize.c lvresize: allow mixing striped with errors or zero 2021-03-18 18:56:49 +01:00
lvscan.c Remove lvmetad 2018-07-11 11:26:42 -05:00
Makefile.in makefiles: sanitize environment 2021-09-06 14:00:20 +02:00
polldaemon.c polldaemon: improve support for interruptions 2021-04-06 22:02:31 +02:00
pvchange.c cov: clean up pvid and vgid usage 2021-08-16 11:31:15 -05:00
pvck.c cov: make more obvious buffer is zero ended 2021-09-27 18:56:13 +02:00
pvcreate.c device usage based on devices file 2021-02-23 16:43:32 -06:00
pvdisplay.c add device hints to reduce scanning 2019-01-15 10:23:47 -06:00
pvmove_poll.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
pvmove_poll.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pvmove.c archiving: take archive automatically 2021-06-09 14:56:13 +02:00
pvremove.c pvcreate: call label scan prior to pvcreate_each_device 2019-04-30 14:10:27 -05:00
pvresize.c exported vg handling 2019-06-25 15:39:08 -05:00
pvscan.c add activation services 2021-10-29 16:29:42 -05:00
reporter.c cleanup: use dm_list_empty 2021-10-06 15:43:31 +02:00
segtypes.c doc: change fsf address 2016-01-21 12:11:37 +01:00
stub.h Remove vgconvert 2018-06-13 14:14:03 -05:00
tags.c doc: change fsf address 2016-01-21 12:11:37 +01:00
tool.h configure: avoid repeative inclusion of configure.h 2018-12-21 19:19:50 +01:00
toollib.c add activation services 2021-10-29 16:29:42 -05:00
toollib.h add activation services 2021-10-29 16:29:42 -05:00
tools.h add activation services 2021-10-29 16:29:42 -05:00
vals.h tools: correct units description 2021-04-19 14:40:14 +02:00
vgcfgbackup.c improve reading and repairing vg metadata 2019-06-07 15:54:04 -05:00
vgcfgrestore.c gcc-fanalyzer: explicit test null not pass 2021-09-20 10:51:30 +02:00
vgchange.c add activation services 2021-10-29 16:29:42 -05:00
vgck.c vgck: fix updatemetadata writing different descriptions 2019-10-11 12:57:32 -05:00
vgcreate.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
vgdisplay.c tidy: Add missing underscores to statics. 2017-10-18 15:58:13 +01:00
vgexport.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
vgextend.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
vgimport.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
vgimportclone.c gcc-fanalyzer: use zeroed memory 2021-09-20 13:58:57 +02:00
vgimportdevices.c vgimportdevices: skip lvmlockd locking 2021-10-25 12:11:17 -05:00
vgmerge.c vgmerge: support option --poolmetadataspare 2021-07-23 16:36:31 +02:00
vgmknodes.c process_each_lv: add check_single_lv function 2017-02-13 08:20:10 -06:00
vgreduce.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
vgremove.c vgremove: remove forgotten pmspare 2021-07-21 13:19:51 +02:00
vgrename.c cov: clean up pvid and vgid usage 2021-08-16 11:31:15 -05:00
vgscan.c locking: unify global lock for flock and lockd 2019-04-29 13:01:05 -05:00
vgsplit.c vgsplit: add support for option --poolmetadataspare 2021-07-21 15:56:33 +02:00