mdadm: fix systemd service start up failure

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

fixed by use option -y to cause all events to be reported
through 'syslog'.

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

fix by create dir before starting.

(From OE-Core rev: d18c937918ec3553cb98743088a37ff080af2491)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Changqing Li
2019-06-24 16:08:40 +08:00
committed by Richard Purdie
parent 930a00cd20
commit 98373868d2

View File

@@ -13,7 +13,8 @@ ConditionPathExists=/etc/mdadm.conf
Type=forking
PIDFile=/var/run/mdadm/mdadm.pid
EnvironmentFile=-/etc/sysconfig/mdmonitor
ExecStart=/sbin/mdadm --monitor --scan -f --pid-file=/var/run/mdadm/mdadm.pid
ExecStartPre=mkdir -p /var/run/mdadm
ExecStart=/sbin/mdadm --monitor -y --scan -f --pid-file=/var/run/mdadm/mdadm.pid
[Install]
WantedBy=multi-user.target