Re: [OE-core] [PATCHv2] mdadm:add mdmonitor.service

2019-07-29 Thread Richard Purdie
On Mon, 2019-07-29 at 09:33 +0800, Zang Ruochen wrote:
> -The original file mdmonitor.service is as follows:
> ...
> > [Service]
> > Environment=  MDADM_MONITOR_ARGS=--scan
> > EnvironmentFile=-/run/sysconfig/mdadm
> > ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh
> > ExecStart=/sbin/mdadm --monitor -y $MDADM_MONITOR_ARGS
> ...
> -It has a syntax error and it doesn't work properly, 
>  so add new file mdmonitor.service to overwrite it.

This is better as it tells us what the problem is but it still isn't
quite what I asked for.

Can we patch the file that mdadm is installing so the difference is
clear to anyone reading the recipe? The patch will also have comments
as above so that people don't have to find this commit to understand
why we're changing it and what the problem is. If/as/when upstream
fixes it we'll also be able to drop the patch, rather than not knowing
if/when its fixed.

Thanks,

Richard

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCHv2] mdadm:add mdmonitor.service

2019-07-28 Thread Zang Ruochen
-The original file mdmonitor.service is as follows:
...
|[Service]
|Environment=  MDADM_MONITOR_ARGS=--scan
|EnvironmentFile=-/run/sysconfig/mdadm
|ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh
|ExecStart=/sbin/mdadm --monitor -y $MDADM_MONITOR_ARGS
...
-It has a syntax error and it doesn't work properly, 
 so add new file mdmonitor.service to overwrite it.

Signed-off-by: Zang Ruochen 
---
 meta/recipes-extended/mdadm/files/mdmonitor.service | 10 ++
 meta/recipes-extended/mdadm/mdadm_4.1.bb|  2 ++
 2 files changed, 12 insertions(+)
 create mode 100644 meta/recipes-extended/mdadm/files/mdmonitor.service

diff --git a/meta/recipes-extended/mdadm/files/mdmonitor.service 
b/meta/recipes-extended/mdadm/files/mdmonitor.service
new file mode 100644
index 00..4f07c755ae
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/mdmonitor.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Software RAID monitoring and management
+ConditionPathExists=/etc/mdadm.conf
+[Service]
+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
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-extended/mdadm/mdadm_4.1.bb 
b/meta/recipes-extended/mdadm/mdadm_4.1.bb
index 74c94f6ecb..daa2ed8e2e 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.1.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.1.bb
@@ -20,6 +20,7 @@ SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
file://debian-no-Werror.patch \

file://0001-Revert-tests-wait-for-complete-rebuild-in-integrity-.patch \
   file://mdadm.init \
+  file://mdmonitor.service \
   
file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \
file://include_sysmacros.patch \
"
@@ -65,6 +66,7 @@ do_install_append() {
 
 do_install_append() {
 oe_runmake install-systemd DESTDIR=${D}
+install -m 644 ${WORKDIR}/mdmonitor.service 
${D}/lib/systemd/system/mdmonitor.service
 }
 
 do_compile_ptest() {
-- 
2.20.1



-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core