Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] mdadm: fix systemd service start up failure
@ 2019-06-20  3:14 changqing.li
  2019-06-20  7:35 ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: changqing.li @ 2019-06-20  3:14 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

1. mdadm: No mail address or alert command - not monitoring

with --monitor mode, mdadm needs a mail address and/or a program.
This can be given with "mailaddr" and "program" lines to that
monitoring can be started using.

fix by given a mail address, user can replace with a valid one
when use.

2. cannot create pid file: No such file or directory

fix by create dir before starting.

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-extended/mdadm/files/mdmonitor.service | 1 +
 meta/recipes-extended/mdadm/mdadm_4.1.bb            | 1 +
 2 files changed, 2 insertions(+)

diff --git a/meta/recipes-extended/mdadm/files/mdmonitor.service b/meta/recipes-extended/mdadm/files/mdmonitor.service
index bd243b4..a1b693f 100644
--- a/meta/recipes-extended/mdadm/files/mdmonitor.service
+++ b/meta/recipes-extended/mdadm/files/mdmonitor.service
@@ -13,6 +13,7 @@ ConditionPathExists=/etc/mdadm.conf
 Type=forking
 PIDFile=/var/run/mdadm/mdadm.pid
 EnvironmentFile=-/etc/sysconfig/mdmonitor
+ExecStartPre=mkdir -p /var/run/mdadm
 ExecStart=/sbin/mdadm --monitor --scan -f --pid-file=/var/run/mdadm/mdadm.pid
 
 [Install]
diff --git a/meta/recipes-extended/mdadm/mdadm_4.1.bb b/meta/recipes-extended/mdadm/mdadm_4.1.bb
index 494b81b..aa1fdb3 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.1.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.1.bb
@@ -57,6 +57,7 @@ do_install() {
 do_install_append() {
         install -d ${D}/${sysconfdir}/
         install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf
+        sed -i -e 's/#MAILADDR root@mydomain.tld/MAILADDR root@mydomain.tld/g' ${D}${sysconfdir}/mdadm.conf
         install -d ${D}/${sysconfdir}/init.d
         install -m 755 ${WORKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor
 }
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-24  8:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-20  3:14 [PATCH] mdadm: fix systemd service start up failure changqing.li
2019-06-20  7:35 ` Adrian Bunk
2019-06-20  9:12   ` Changqing Li
2019-06-24  8:08   ` [PATCH V2] " changqing.li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox