KatharaFramework / Docker-Images

Dockerfiles and scripts to build Kathará Docker images.
https://www.kathara.org/
GNU General Public License v3.0
22 stars 9 forks source link

Cannot start FRR on Fedora and Arch using `kathara/frr` image #10

Open tcaiazzi opened 11 months ago

tcaiazzi commented 11 months ago

Thanks to @Aperence and @buonhobo, we found an error while starting frr.service on Fedora (KatharaFramework/Kathara-Labs#31) and Arch (KatharaFramework/Kathara#248).

Substantially, when running FRR on a Fedora or Arch host using the kathara/frr image, it returns the error fork(): Cannot allocate memory.

root@r3:/# systemctl start frr
fork(): Cannot allocate memory
Failed to start watchfrr! ... failed!

Currently, we don't know the reason for the problem, however @buonhobo provided us a workaround to temporary fix it :heart_eyes:

It's pretty simple, it only requires adding a file named /etc/systemd/system/frr.service.d/workaround.conf in the kathara/frr image.

This is the file's content:

[Service]
ExecStart=
ExecStop=
ExecReload=
ExecStart=/usr/bin/su -c "/usr/lib/frr/frrinit.sh start"
ExecStop=/usr/bin/su -c "/usr/lib/frr/frrinit.sh stop"
ExecReload=/usr/bin/su -c "/usr/lib/frr/frrinit.sh reload"

This will override the default frr systemd unit so that it wraps the command with su.

We need to include the workaround in the next kathara/frr release.

BuonHobo commented 11 months ago

Thank you for the mention!

I've already forked this repo and made the change to fix it, you can see it here.

I had spoken with @lorenzo93 about opening a PR but we decided not to (he said you'd rather find a real fix).

If you want, I can open a PR later today with this (small) change.

tcaiazzi commented 11 months ago

I had spoken with @lorenzo93 about opening a PR but we decided not to (he said you'd rather find a real fix).

Oh, I missed it. However, after discussing, we think it is better to include the workaround to avoid problems with students. I will test the new image on all the platforms and if it works, we will add the workaround.

BuonHobo commented 11 months ago

I also think it's better for the (admittedly few) students with Fedora and Arch. I opened the PR :)