Bug 1933679

Summary: [RHEL-8.4][RHEL-8.5][iscsi]Restart kdump service reports ‘sed: can't read /etc/sysconfig/network/ifcfg-eno1: Not a directory ’
Product: Red Hat Enterprise Linux 8 Reporter: xiaoying yan <yiyan>
Component: dracutAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED ERRATA QA Contact: Frantisek Sumsal <fsumsal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.4CC: coxu, dracut-maint-list, dtardon, fsumsal, pvalena, ruyang, xiawu
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dracut-049-209.git20220815.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1952397 (view as bug list) Environment:
Last Closed: 2022-11-08 10:48:46 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: 1952397, 2026666, 2089955    

Comment 3 Coiby 2021-04-22 01:28:36 UTC
Hi xiaoying,

Can you show the result of `ls /etc/sysconfig/network-scripts/`?

I thought this bug has the same root cause as https://bugzilla.redhat.com/show_bug.cgi?id=1919052. In that case, the error should be ‘sed: can't read /etc/sysconfig/network-scripts/ifcfg-eno1: Not a directory ’.

Can you also paste the result of "kdumpctl rebuild" after inserting a line "set -x" to the beginning of the install function in /usr/lib/dracut/modules.d/99kdumpbase/module-setup.sh?
```
install() { 
    set -x 
    local arch 
    ...
}
```

I want to know which line of code cause ‘sed: can't read /etc/sysconfig/network/ifcfg-eno1: Not a directory ’. 

Thanks!

Comment 5 Coiby 2021-04-22 08:11:25 UTC
The root cause of this bug is dracut/modules.d/95iscsi tries to set up ip=eno1:dhcp by parsing /etc/sysconfig/network/ifcfg-eno1 which doesn't exit,
```
install_iscsiroot() { 
    ...
    #follow ifcfg settings for boot protocol
    bootproto=$(sed -n "/BOOTPROTO/s/BOOTPROTO='\([[:alpha:]]*6\?\)4\?'/\1/p" /etc/sysconfig/network/ifcfg-$ifname)
    if [ $bootproto ]; then
        printf 'ip=%s:%s ' ${ifname} ${bootproto}
    else
        printf 'ip=%s:static ' ${ifname}
    fi
```

I notice the upstream dracut has already fixed this issue by using ip_params_for_remote_addr which will check both /etc/sysconfig/network/ifcfg-$ifname and /etc/sysconfig/network-scripts/ifcfg-$ifname.

Btw, for RHEL9, ifcfg scripts are no longer used. So the same error would happen. I'll clone a bug for REHL9.

Comment 11 Coiby 2022-08-02 09:53:44 UTC
Hi Frantisek,

Could you confirm if this bug has been fixed in RHEL 8.6 and 8.7? Thanks!

Comment 12 Frantisek Sumsal 2022-08-04 10:57:01 UTC
(In reply to Coiby from comment #11)
> Hi Frantisek,
> 
> Could you confirm if this bug has been fixed in RHEL 8.6 and 8.7? Thanks!

I don't think so, https://github.com/dracutdevs/dracut/pull/857 is not in RHEL 8 yet.

Comment 19 errata-xmlrpc 2022-11-08 10:48:46 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 (dracut bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2022:7725