From: Scott Moser <smoser-tZfQ4l0FZIvk1uMJSBkQmQ@public.gmane.org>
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Exit non-zero on error / how to detect failure?
Date: Thu, 24 Feb 2022 12:57:35 -0500 [thread overview]
Message-ID: <CAKxE60w22VmhWMrfN2y=MTEH+EniWn02R6a3+ynE6vPK5GjyBA@mail.gmail.com> (raw)
I recently built a initramfs with dracut in debian (051-1), but
it seems this is still a problem on mainline.
I have a config in /etc/dracut/dracut.conf.d that said:
install_items+="/etc/usermode-helper.conf usermode-helper"
An error elsewhere meant that those items were missing from the filesystem.
dracut exited 0 with emitted messages like:
dracut-install: ERROR: installing '/etc/usermode-helper.conf'
dracut-install: ERROR: installing 'usermode-helper'
dracut: FAILED: /usr/lib/dracut/dracut-install -D <dir> \
-a -l /etc/usermode-helper.conf usermode-helper
In my usage, this is a FATAL error, and failure to catch it here meant lost
time down the road. I "solved" it by capturing output and grepping
for "ERROR:" or "FAILED:", but that is less than desirable.
Is there a way to tell dracut to exit non-zero on errors like this?
Scott
next reply other threads:[~2022-02-24 17:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 17:57 Scott Moser [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-02-24 17:45 Exit non-zero on error / how to detect failure? Scott Moser
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='CAKxE60w22VmhWMrfN2y=MTEH+EniWn02R6a3+ynE6vPK5GjyBA@mail.gmail.com' \
--to=smoser-tzfq4l0fzivk1umjsbkqmq@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).