Bug 2037897

Summary: Please backport "fix(dracut): be more robust when using 'set -u'"
Product: Red Hat Enterprise Linux 9 Reporter: Renaud Métrich <rmetrich>
Component: dracutAssignee: Pavel Valena <pvalena>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: dracut-maint-list, dtardon, sarroutb, scorreia
Target Milestone: rcKeywords: Improvement, TestOnly, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dracut-057-13.git20220816.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-17 18:25:45 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: 2066816    
Bug Blocks: 2022420    

Description Renaud Métrich 2022-01-06 19:13:48 UTC
Description of problem:

See PR https://github.com/dracutdevs/dracut/pull/1683.
This is required to implement BZ# 2022420 because clevis-luks-askpath makes use of 'set -u' for robustness.


Version-Release number of selected component (if applicable):

dracut-055-10.git20210824.el9.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Implement RFE #2022420 on a Luks system with clevis+tang and boot the system with 'rd.debug'

Actual results:

clevis-luks-askpass dies:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Jan 06 18:18:37 vm-rhel9 clevis-luks-askpass[497]: //usr/bin/clevis-luks-common-functions@33(enable_debugging): set -e
Jan 06 18:18:37 vm-rhel9 clevis-luks-askpass[497]: /usr/libexec/clevis-luks-askpass: line 26: FUNCNAME[0]: unbound variable
 :
Jan 06 18:18:37 vm-rhel9 systemd[1]: Received SIGCHLD from PID 497 (clevis-luks-ask).
Jan 06 18:18:37 vm-rhel9 systemd[1]: Child 497 (clevis-luks-ask) died (code=exited, status=1/FAILURE)
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Expected results:

clevis-luks-askpass executes properly without dying

Comment 3 David Tardon 2022-07-29 05:46:38 UTC
Hello, please test, if you can, whether the planned rebase for 9.1 works for you.

RPMS: https://github.com/pvalena/rpms/tree/main/dracut/2066816

Comment 4 Sergio Correia 2022-08-01 12:16:31 UTC
Hi David: tested with dracut-057-10.git20220721 and it works, thanks!