Error in /lib/dracut/hooks/pre-pivot/92-anaconda-dnsconfd.sh?

I was installing (unattended via virt-install and kickstart) a test VM (to play with postgres) and I happened to spot this error message zooming past during the build:

         Starting dracut pre-pivot and cleanup hook...
[  107.784675] dracut-pre-pivot[2184]: //lib/dracut/hooks/pre-pivot/92-anaconda-dnsconfd.sh: line 7: [: ==: unary operator expected
[  OK  ] Finished dracut pre-pivot and cleanup hook.

It doesn’t stop the build from completing and everything appears to be working fine. I just thought it worth mentioning in case anyone feels like taking a look.

If it helps, this is the command I used to build the VM:

/usr/bin/virt-install --noreboot -n pgtest -r 4096 --vcpus=1 --os-variant=rocky9 --machine pc-i440fx-rhel7.6.0 --accelerate -v --network=bridge=br-lan,target=v-pgtest --disk path=/dev/SSD/vm.pgtest -l https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/kickstart/ --nographics -x inst.ks=http://10.0.0.137/CentOS/kickstart/rocky9.cfg ksdevice=ens2 ip=dhcp console=ttyS0,9600

So I’m downloading the installer image from the rocky site.

The (relevant parts of the) kickstart file:

text
url --url https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/
repo --name=AppStream --mirrorlist https://mirrors.rockylinux.org/mirrorlist?repo=AppStream-9&arch=x86_64

poweroff

lang en_US.UTF-8
keyboard us

network --onboot yes --device eth0 --bootproto dhcp --ipv6 auto

rootpw  --iscrypted $6$blahblah
firewall --disabled
selinux --disabled

timezone --utc America/New_York

zerombr
clearpart --all --initlabel
part /boot --fstype=ext4 --asprimary --size=1024
part swap --asprimary --size=1024
part / --fstype=ext4 --asprimary --grow --size=1

%packages
@^minimal-environment
%end

%addon com_redhat_kdump --disable --reserve-mb='auto'
%end

%post
exec 1>/root/ks-post.log 2>&1
tail -f /root/ks-post.log > /dev/console &

As I said, the VM builds and runs so it seems a harmless message.

As I understand it, this only happens at install time (anaconda); it does not happen once the o/s is installed?

Yeah, early on in the anaconda install process. I don’t see any issues in a normal boot; presumably because pre-pivot/92-anaconda-dnsconfd.sh isn’t present on the installed server :slight_smile:

If it helps (or is of interested) there’s a build log at https://sweh.spuddy.org/tmp/rocky9-buildlog.txt

I also note there’s a 100+ second delay in the netboot process before dracut-initqueue downloads whatever it’s looking for (see timestamp at 111.494). It’s just sitting there doing nothing, but once it starts it downloads immediately. Dunno if that’s related at all.

OK, I think I’ve found the problem. In https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/kickstart/isolinux/initrd.img and https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/kickstart/images/pxeboot/initrd.img

% cat ./usr/lib/dracut/hooks/pre-pivot/92-anaconda-dnsconfd.sh
#!/usr/bin/bash
# Enable dnsconfd.service in installer environment
# if dnsconfd backend is used.

dns_backend=$(getarg rd.net.dns-backend=)

if [ ${dns_backend} == "dnsconfd" ]; then
    systemctl --root=/sysroot enable dnsconfd.service
fi

There should be "" in the if test.

This appears to be fixed in the upstream git repo; anaconda/dracut/anaconda-dnsconfd.sh at main · rhinstaller/anaconda · GitHub

Dunno if this is a RedHat original issue or from Rocky customisations.