summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2014-12-05 12:10:27 -0600
committerDavid Teigland <teigland@redhat.com>2014-12-05 16:09:56 -0600
commitaa2672567c97f1052b80185edd29e63aac29b6d8 (patch)
tree33b07b830b0f21cfbc4c622e22d15fabed2ec6e2
parent2ef061a23340641a42e11be1b0073420e422655c (diff)
downloadlvm2-dev-dct-lvmlockd-H.tar.gz
lvmlockd: systemd service filesdev-dct-lvmlockd-H
lvm2-lvmlockd: start/stop the lvmlockd daemon. lvm2-lvmlocking: start/stop lockspaces for lockd VGs, and activate/deactivate LVs in those VGs after/before the lockspaces have started/stopped. Starting/joining the VG lockspaces can take quite a while, and require the lock manager used by the VGs to be running.
-rw-r--r--scripts/lvm2-lvmlockd.service.in16
-rw-r--r--scripts/lvm2-lvmlocking.service.in27
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
+