Bug 1121362

Summary: dracut doesn't return error rc if given --add / --force-add modules fail
Product: Red Hat Enterprise Linux 7 Reporter: Frank Ch. Eigler <fche>
Component: dracutAssignee: dracut-maint
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: dracut-maint-list, harald, jbastian, jstodola, mbanas
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: dracut does not return with an error code, if some required components given could not be found. Consequence: Other than reading the log of dracut, there was no way to figure out, that some required components were not installed in the initramfs. Fix: dracut returns with an error code now, if dracut modules, which were specified to be added in the initramfs, were not actually installed. Result: The process of initramfs now fails and it can be reacted upon it immediately.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 08:21:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1170368    

Description Frank Ch. Eigler 2014-07-19 20:29:50 UTC
Some tools invoke dracut, with a few extra module activation parameters,
expecting that if dracut returned rc=0, all is well.  But not so:

# /sbin/dracut --force-add FOOBAR --force /boot/soijsdf `uname -r`
dracut module 'FOOBAR' cannot be found or installed.
dracut module 'FOOBAR' cannot be found or installed.
# echo $?
0
# rpm -q dracut
dracut-033-161.el7.x86_64

(Same for "--add".)

This means that that the invoking tool has no way of knowing that
the dracut rebuild actually failed.

Comment 10 Jan Stodola 2015-01-06 12:27:42 UTC
[root@localhost ~]# rpm -q dracut
dracut-033-227.el7.x86_64
[root@localhost ~]# /sbin/dracut --force-add FOOBAR --force /boot/soijsdf `uname -r`
dracut module 'FOOBAR' cannot be found or installed.
[root@localhost ~]# echo $?
1
[root@localhost ~]# /sbin/dracut --add FOOBAR --force /boot/soijsdf `uname -r`
dracut module 'FOOBAR' cannot be found or installed.
[root@localhost ~]# echo $?
1
[root@localhost ~]#

Moving to VERIFIED.

Comment 12 errata-xmlrpc 2015-03-05 08:21:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0375.html