diff options
-rw-r--r-- | scripts/lvm2-lvmlockd.service.in | 16 | ||||
-rw-r--r-- | scripts/lvm2-lvmlocking.service.in | 27 |
2 files changed, 43 insertions, 0 deletions
diff --git a/scripts/lvm2-lvmlockd.service.in b/scripts/lvm2-lvmlockd.service.in new file mode 100644 index 000000000..17c7dbf91 --- /dev/null +++ b/scripts/lvm2-lvmlockd.service.in @@ -0,0 +1,16 @@ +[Unit] +Description=LVM2 lock daemon +Documentation=man:lvmlockd(8) +After=lvm2-lvmetad.service + +[Service] +Type=simple +NonBlocking=true +ExecStart=@sbindir@/lvmlockd -f +Environment=SD_ACTIVATION=1 +PIDFile=@LVMLOCKD_PIDFILE@ +SendSIGKILL=no + +[Install] +WantedBy=multi-user.target + diff --git a/scripts/lvm2-lvmlocking.service.in b/scripts/lvm2-lvmlocking.service.in new file mode 100644 index 000000000..5e7144c58 --- /dev/null +++ b/scripts/lvm2-lvmlocking.service.in @@ -0,0 +1,27 @@ +[Unit] +Description=Availability of lockspaces in lvmlockd +Documentation=man:lvmlockd(8) +After=lvm2-lvmlockd.service +# The steps below require sanlock|dlm to be available, +# use After dlm.service and sanlock.service? + +[Service] +Type=oneshot + +# start lockspaces and wait for them to finish starting +ExecStart=@sbindir@/vgchange --lock-start --lock-opt autowait + +# auto activate lockd LVs in the newly started VGs +# ExecStart=@sbindir@/vgchange -aay -S 'lock_type={sanlock,dlm}' +ExecStart=@sbindir@/vgchange -aay + +# deactivate lockd LVs +# ExecStop=@sbindir@/vgchange -an -S 'lock_type={sanlock,dlm}' +ExecStop=@sbindir@/vgchange -an + +# stop lockspaces and wait for them to finish stopping +ExecStop=@sbindir@/lvmlock --stop-lockspaces --wait + +[Install] +WantedBy=multi-user.target + |