Thanks! You are right, in such case dracut-initqueue will stuck in
"activating" status, I think maybe the only way to check if the
service is check with "systemctl status", will update the patch.
You are welcome! It seems this is the intended behaviour of
dracut-intique that it succeeds when there is script inside
"$hookdir/initqueue/finished" that never return true. A systemd service
succeeds when exit code status is 0. Since
modules.d/98dracut-systemd/dracut-initqueue.sh could deal with this case
and exit with code 0, "systemctl is-failed" is false. So we need
another way to simulate the situation where the dracut-intique service
failes.
On Wed, Apr 21, 2021 at 7:19 PM Coiby Xu <coxu(a)redhat.com>
wrote:
>
> On Wed, Apr 21, 2021 at 05:50:38PM +0800, Coiby Xu wrote:
> >On Thu, Apr 08, 2021 at 12:18:57PM +0800, Kairui Song wrote:
> >>This reverts commit 7f1f8f229f546818a891400ac7961e485dcd6f3c again.
> >>Previous, kdump's dump_to_rootfs tried to detect if initqueue is
> >>running and don't start it if it's already running or failed.
> >>
> >>But dump_to_rootfs will run after systemd isolate to emergency
> >>target, so previous service status are lost, and the detect
> >>is invalid always return false.
> >>
> >>But now we can remove the isolate wrapper in following commitsa,
> >>this detection will be valid and helpful again.
> >>
> >>Signed-off-by: Kairui Song <kasong(a)redhat.com>
> >>---
> >>kdump-lib-initramfs.sh | 7 +++++--
> >>1 file changed, 5 insertions(+), 2 deletions(-)
> >>
> >>diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
> >>index 5cb0223..eb4b07e 100755
> >>--- a/kdump-lib-initramfs.sh
> >>+++ b/kdump-lib-initramfs.sh
> >>@@ -218,8 +218,11 @@ save_opalcore_fs() {
> >>dump_to_rootfs()
> >>{
> >>
> >>- dinfo "Trying to bring up rootfs device"
> >>- systemctl start dracut-initqueue
> >>+ if ! ( systemctl is-active dracut-initqueue || systemctl is-failed
dracut-initqueue ) &> /dev/null; then
> > ^^
> >I think you meant to use "&&" for "||", right?
> >
>
> Oh, I made a mistake. "||" is correct here. But the following
> description is still valid.
>
> >But even with this fix, dracut-initque could be inactive but not in a
> >failed state. Based on you suggestion you gave me in IRC chat, I added
> >the following code to the beginning of the install function of
> >dracut-module-setup.sh,
> >
> > hookdir="$initdir/usr/lib/dracut/hooks/"
> > printf -- '[ -e /non-exists ]\n' >>
"$hookdir/initqueue/finished/99-fail.sh"
> >
> >I thought the above code would make "systemctl is-failed
dracut-initqueue" return
> >true. But it turned out otherwise.
> >
> >Btw, with the above tweak, dracut-initqueue would timeout the first
> >time. But trying to restart initqueue would lead the system to hang
> >forever and I didn't notice any timeout message from initqueue. So the
> >following
> >commit message of "[PATCH v3 2/3] Remove the kdump error handler
> >isolation wrapper" is not accurate,
> >
> >>"When dracut called emergency service because initqueue
> >>timed out, dump_to_rootfs will try start initqueue again and timeout
> >>again."
> >
> >>+ dinfo "Trying to bring up initqueue for rootfs mount"
> >>+ systemctl start dracut-initqueue
> >>+ fi
> >>+
> >> dinfo "Waiting for rootfs mount, will timeout after 90
seconds"
> >> systemctl start sysroot.mount
> >>
> >>--
> >>2.30.2
> >>_______________________________________________
> >>kexec mailing list -- kexec(a)lists.fedoraproject.org
> >>To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> >>Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> >>List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> >>List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org
> >>Do not reply to spam on the list, report it:
https://pagure.io/fedora-infrastructure
> >
> >--
> >Best regards,
> >Coiby
>
> --
> Best regards,
> Coiby
>
--
Best Regards,
Kairui Song