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 ~
This requires some reworking actually for 4.4.
(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
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(+)