Kiwi NG hangs on RPM installation that is using /dev/urandom

43 views
Skip to first unread message

sebastiaan...@gmail.com

unread,
Sep 11, 2024, 4:55:14 AM9/11/24
to kiwi
Hi,

I'm facing a weird issue with building a SLES 15 SP5 VMX flavour. The build process just hangs on installing my own compiled freeradius RPM:

[ DEBUG   ]: 10:42:09 | system: (492/530) Installing: freeradius-server-3.2.6-150500.155.199.1.NIVO.SLES15.x86_64

The same RPM installs fine when the VM is build without this RPM and installing it after first boot. Further investigation shows me that Kiwi hangs on my %post section inside the RPM. The Kiwi process causes high load on running:

root     26287 96.3  0.0   2564   712 pts/0    R    10:42   4:33          \_ tr -cd [:alnum:]

My relevant part of the RPM %post section:

PASSWD=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w16 | head -n1)

Are there any known problem with using urandom inside the chroot? Or has this something to do with the subshell? I'm using KIWI (next generation) version 9.25.22.

Thanks!

Sebastiaan

Marcus Schäfer

unread,
Sep 11, 2024, 6:39:07 AM9/11/24
to kiwi-...@googlegroups.com
Hi,

> PASSWD=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w16 | head -n1)
>
> Are there any known problem with using urandom inside the chroot? Or
> has this something to do with the subshell? I'm using KIWI (next
> generation) version 9.25.22.

Hmm, not to my knowledge

Does it behave differently if you put the package into the bootstrap
section of your image description ?

<packages type="bootstrap">
<package name="freeradius-server"/>
<... the other bootstrap stuff ...
</packages>

The bootstrap installaton process is no chroot process,
just to double check if that makes any difference

Regards,
Marcus
--
Public Key available via: https://keybase.io/marcus_schaefer/key.asc
keybase search marcus_schaefer
signature.asc

Sebastiaan Veldhuisen

unread,
Sep 11, 2024, 7:17:24 AM9/11/24
to kiwi-...@googlegroups.com
Hi Marcus,

Let me check whether I see the same behaviour when specifying the RPM inside the bootstrap section. It is really strange: the bash line generating a random password eats up a single CPU. Kiwi waits on the process to be finished. When doing a hard kill (-9) on the "tr" process, Kiwi continues and the build succeeds (except for the freeradius-server RPM installation ofcourse).

Thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "kiwi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kiwi-images/dpQTPlQ0MTk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kiwi-images...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kiwi-images/ZuFzRABONm-CEJF_%40asterix.

Sebastiaan Veldhuisen

unread,
Sep 11, 2024, 8:03:13 AM9/11/24
to kiwi-...@googlegroups.com

We did a test by placing "freeradius-server" inside the bootstrap section: the result is the same.

Marcus Schäfer

unread,
Sep 11, 2024, 9:21:16 AM9/11/24
to kiwi-...@googlegroups.com
Hi,

> We did a test by placing "freeradius-server" inside the bootstrap
> section: the result is the same.

ok, so no chroot issue. In this case I think you run out of entropy
and that makes the read to block.

I did a very quick search on hanging shells when reading from
urandom. Maybe the information from here helps:

https://stackoverflow.com/questions/29493229/why-cat-dev-urandom-hung-my-bash-script

Other than that there is really little from the kiwi side
that we can do here
signature.asc

Sebastiaan Veldhuisen

unread,
Sep 11, 2024, 12:40:33 PM9/11/24
to kiwi-...@googlegroups.com
Hi Marcus,

Thanks. I did not known about the bad practice to cat /dev/urandom. I guess I have learned something new today. If somebody else has the same problem:

dd bs=16 count=1 if=/dev/urandom | base64 | tr +/ _.


Works fine!

Thanks for your expertise!

kind regards,

Sebastiaan

--
You received this message because you are subscribed to a topic in the Google Groups "kiwi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kiwi-images/dpQTPlQ0MTk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kiwi-images...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages