From: Blazej Kucman <blazej.kucman@linux.intel.com>
To: miaoguanqin <miaoguanqin@huawei.com>
Cc: Jes Sorensen <jes@trained-monkey.org>,
Martin Wilck <mwilck@suse.com>,
Paul Menzel <pmenzel@molgen.mpg.de>, <colyli@suse.de>,
<linux-raid@vger.kernel.org>, linfeilong <linfeilong@huawei.com>,
<louhongxiang@huawei.com>,
"liuzhiqiang (I)" <liuzhiqiang26@huawei.com>
Subject: Re: [QUESTION]mdadm4.1 upgrade to mdadm4.2,mdmonitor services failed to start if no raid in environment
Date: Thu, 11 May 2023 15:48:07 +0200 [thread overview]
Message-ID: <20230511154409.00002c8c@linux.intel.com> (raw)
In-Reply-To: <1c85276f-b44a-07f1-dd34-b853c5f7529f@huawei.com>
On Thu, 11 May 2023 15:56:31 +0800
miaoguanqin <miaoguanqin@huawei.com> wrote:
> Hi
> Here we meet a question. After we upgrade mdadm from 4.1 to 4.2, we
> execute :
> systemctl start mdmonitor
> the mdmonitor service failed to start when no raid device in
> environment. error message are as follows:
>
> mdmonitor.service - MD array monitor
> Loaded: loaded (/usr/lib/systemd/system/mdmonitor.service;
> enabled; vendor preset: enabled)
> Active: failed (Result: protocol) since Thu 2023-05-11 10:52:32
> CST; 5s ago
> Process: 999741 ExecStartPre=mkdir -p /run/mdadm (code=exited,
> status=0/SUCCESS)
> Process: 999743 ExecStart=/sbin/mdadm --monitor
> $MDADM_MONITOR_ARGS -f --pid-file=/run/mdadm/mdadm.pid (c>
>
> May 11 10:52:32 localhost.localdomain systemd[1]: Starting MD array
> monitor...
> May 11 10:52:32 localhost.localdomain systemd[1]: mdmonitor.service:
> Can't open PID file /run/mdadm/mdadm.pid>
> May 11 10:52:32 localhost.localdomain systemd[1]: mdmonitor.service:
> Failed with result 'protocol'.
> May 11 10:52:32 localhost.localdomain systemd[1]: Failed to start MD
> array monitor.
>
> In the mdmonitor service file, type is set to forking and the PIDFILE
> field is set. The systemd detection process is as follows:
> (1)when the parent process exits, a signal is sent to systemd
> (2)systemd wakes up and checks whether pidfile exists by PIDFILE
> field. (3)If the pidfile file does not exist, the service status is
> set to fail. In function Monitor code logic, after the parent process
> creates a pidfile, before systemd detects the pidfile, the pidfile is
> deleted from the child process. As a result, the systemd cannot
> detect the pidfile and sets the service status to fail.
>
> It is a problem for user, because the mdmonitor service status is
> fail. If there is no RAID device in the environment, We want the
> service status is expected to be inactive after the service is
> started. Can you have any advice for this problem ?
Hi,
I do not know if the service should be in this state for such a case,
but the start of the mdmonitor service is also forced by udev rule
udev-md-raid-arrays.rules
# ENV{MD_LEVEL}=="raid[1-9]*", ENV{SYSTEMD_WANTS}+="mdmonitor.service"
so if the service is failed, it will be started anyway after creating
a new RAID.
Regards,
Blazej
prev parent reply other threads:[~2023-05-11 13:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 7:56 [QUESTION]mdadm4.1 upgrade to mdadm4.2,mdmonitor services failed to start if no raid in environment miaoguanqin
2023-05-11 13:48 ` Blazej Kucman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230511154409.00002c8c@linux.intel.com \
--to=blazej.kucman@linux.intel.com \
--cc=colyli@suse.de \
--cc=jes@trained-monkey.org \
--cc=linfeilong@huawei.com \
--cc=linux-raid@vger.kernel.org \
--cc=liuzhiqiang26@huawei.com \
--cc=louhongxiang@huawei.com \
--cc=miaoguanqin@huawei.com \
--cc=mwilck@suse.com \
--cc=pmenzel@molgen.mpg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.