Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948994 - sys-fs/mdadm-4.2-r3 with systemd: mdmonitor.service fails to start
Summary: sys-fs/mdadm-4.2-r3 with systemd: mdmonitor.service fails to start
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-29 07:48 UTC by Martin Dummer
Modified: 2025-02-13 12:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Dummer 2025-01-29 07:48:54 UTC
when trying to start the mdmonitor.service on a systemd system it fails with the following messages in the journal:

... systemd[1]: Starting MD array monitor...
... (m_env.sh)[1532]: mdmonitor.service: Unable to locate executable '/usr/lib/mdadm/mdadm_env.sh': No such file or directory
... systemd[1]: Started MD array monitor.
... systemd[1]: mdmonitor.service: Main process exited, code=exited, status=1/FAILURE
... systemd[1]: mdmonitor.service: Failed with result 'exit-code'.

Reason: the path to the pre-exec script is wrong. The following patch fixes it:

diff '--color=auto' -Nau a/mdmonitor.service b/mdmonitor.service
--- a/mdmonitor.service 2025-01-29 00:35:05.543494496 +0100
+++ b/mdmonitor.service 2025-01-29 00:36:40.527616649 +0100
@@ -12,5 +12,5 @@
 [Service]
 Environment=  MDADM_MONITOR_ARGS=--scan
 EnvironmentFile=-/run/sysconfig/mdadm
-ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh
+ExecStartPre=-/usr/libexec/mdadm/mdadm_env.sh
 ExecStart=/sbin/mdadm --monitor $MDADM_MONITOR_ARGS
~
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-13 11:14:20 UTC
This requires some reworking actually for 4.4.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-13 11:51:33 UTC
(In reply to Sam James from comment #1)
> This requires some reworking actually for 4.4.

https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=a7a5e676a7eb2ac97acd31b13f75515e9573f891 that is
Comment 3 Larry the Git Cow gentoo-dev 2025-02-13 12:00:44 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3a618d336bbf468e0a58fe7cfd5339fdceabe4a

commit f3a618d336bbf468e0a58fe7cfd5339fdceabe4a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-02-13 11:55:40 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-02-13 11:56:13 +0000

    sys-fs/mdadm: add 4.4
    
    Note that this drops mdadm_env.sh as was done upstream in a7a5e676a7eb2ac97acd31b13f75515e9573f891,
    it's not like it was working correctly anyway for systemd, and for OpenRC,
    the default config only had --syslog in there - yet for OpenRC, it'll continue
    working anyway as it wasn't using mdadm_env.sh to begin with.
    
    Bug: https://bugs.gentoo.org/926289
    Closes: https://bugs.gentoo.org/948994
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/mdadm/Manifest         |   2 +
 sys-fs/mdadm/mdadm-4.4.ebuild | 122 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 124 insertions(+)