aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2017-09-21 04:04:42 -0400
committerMartin Jansa <Martin.Jansa@gmail.com>2017-09-22 22:50:48 +0000
commit82dc6280f4bb6cd00664ee89aa2ab33111da24b6 (patch)
treec4b533606b16546d618b28f45840aed25725f1a8
parent1a1595cbe453bfb37096efd2d953e5d8e8d5a4d3 (diff)
downloadmeta-openembedded-contrib-82dc6280f4bb6cd00664ee89aa2ab33111da24b6.tar.gz
meta-openembedded-contrib-82dc6280f4bb6cd00664ee89aa2ab33111da24b6.tar.bz2
meta-openembedded-contrib-82dc6280f4bb6cd00664ee89aa2ab33111da24b6.zip
lvm2: fix start lvm2-monitor.service failed
While systemd based, start lvm2-monitor.service failed. ... |Sep 21 05:37:34 qemux86-64 lvm[389]: /var/lock: stat failed: No such file or directory |Sep 21 05:37:34 qemux86-64 systemd[1]: lvm2-monitor.service: Main process exited, code=exited, status=5/NOTINSTALLED ... The failure of lvm2-monitor.service caused reboot hung when disk partion is lvm thin provision. While starting lvm2-monitor.service, it reqires the existence of locking dir "/var/lock" which is a symlink to "../run/lock" in oe-core, and "/run" is created in "/etc/fstab" which have to be be after the start of lvm2-monitor.service. So tweak the locking dir to "/tmp/lock" and make sure the dir existence (after tmp.mount). Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-support/lvm2/files/0006-start-lvm2-monitor.service-after-tmp.mount.patch32
-rw-r--r--meta-oe/recipes-support/lvm2/files/lvm.conf2
-rw-r--r--meta-oe/recipes-support/lvm2/lvm2.inc1
3 files changed, 34 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/lvm2/files/0006-start-lvm2-monitor.service-after-tmp.mount.patch b/meta-oe/recipes-support/lvm2/files/0006-start-lvm2-monitor.service-after-tmp.mount.patch
new file mode 100644
index 0000000000..0e68d62fc2
--- /dev/null
+++ b/meta-oe/recipes-support/lvm2/files/0006-start-lvm2-monitor.service-after-tmp.mount.patch
@@ -0,0 +1,32 @@
+From 24a2c47fd01dde1710f1fa66f5c30ce7010c5956 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 21 Sep 2017 15:28:10 +0800
+Subject: [PATCH] start lvm2-monitor.service after tmp.mount
+
+The lvm2-monitor.service reqires the existence of locking_dir
+("/tmp/lock/lvm"), and unit tmp.mount is to mount /tmp.
+So start lvm2-monitor.service after tmp.mount
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ scripts/lvm2_monitoring_systemd_red_hat.service.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/lvm2_monitoring_systemd_red_hat.service.in b/scripts/lvm2_monitoring_systemd_red_hat.service.in
+index 22238b7..93b2bee 100644
+--- a/scripts/lvm2_monitoring_systemd_red_hat.service.in
++++ b/scripts/lvm2_monitoring_systemd_red_hat.service.in
+@@ -2,7 +2,7 @@
+ Description=Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling
+ Documentation=man:dmeventd(8) man:lvcreate(8) man:lvchange(8) man:vgchange(8)
+ Requires=dm-event.socket lvm2-lvmetad.socket
+-After=dm-event.socket dm-event.service lvm2-lvmetad.socket lvm2-activation.service lvm2-lvmetad.service
++After=dm-event.socket dm-event.service lvm2-lvmetad.socket lvm2-activation.service lvm2-lvmetad.service tmp.mount
+ Before=local-fs-pre.target
+ DefaultDependencies=no
+ Conflicts=shutdown.target
+--
+1.8.3.1
+
diff --git a/meta-oe/recipes-support/lvm2/files/lvm.conf b/meta-oe/recipes-support/lvm2/files/lvm.conf
index 9e3b5fe296..c2bb85d8bf 100644
--- a/meta-oe/recipes-support/lvm2/files/lvm.conf
+++ b/meta-oe/recipes-support/lvm2/files/lvm.conf
@@ -214,7 +214,7 @@ global {
# Local non-LV directory that holds file-based locks while commands are
# in progress. A directory like /tmp that may get wiped on reboot is OK.
- locking_dir = "/var/lock/lvm"
+ locking_dir = "/tmp/lock/lvm"
# Other entries can go here to allow you to load shared libraries
# e.g. if support for LVM1 metadata was compiled as a shared library use
diff --git a/meta-oe/recipes-support/lvm2/lvm2.inc b/meta-oe/recipes-support/lvm2/lvm2.inc
index 9791554a99..d2c1474172 100644
--- a/meta-oe/recipes-support/lvm2/lvm2.inc
+++ b/meta-oe/recipes-support/lvm2/lvm2.inc
@@ -15,6 +15,7 @@ SRC_URI = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${PV}.tgz \
file://0004-tweak-MODPROBE_CMD-for-cross-compile.patch \
file://0001-Avoid-bashisms-in-init-scripts.patch \
file://0005-do-not-build-manual.patch \
+ file://0006-start-lvm2-monitor.service-after-tmp.mount.patch \
"
S = "${WORKDIR}/LVM2.${PV}"