Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start frr.service #248

Closed
BuonHobo opened this issue Oct 23, 2023 · 5 comments
Closed

Can't start frr.service #248

BuonHobo opened this issue Oct 23, 2023 · 5 comments

Comments

@BuonHobo
Copy link

BuonHobo commented Oct 23, 2023

Operating System

Arch Linux

Kathará Version

3.7.0

Bug Description

I tried to use this lab which includes an frr configuration for rip.

I start the machines and when I try to run systemctl start frr.service inside any of them it just hangs for a couple of minutes and then it stops without actually starting ripd.

I checked /usr/lib/systemd/system/frr.service and apparently it's trying to run /usr/lib/frr/frrinit.sh start.
I tried to run it manually and this was the output:

root@r3:/# /usr/lib/frr/frrinit.sh start
Starting watchfrr with command: '  /usr/lib/frr/watchfrr  -d  -F traditional   zebra mgmtd ripd staticd'.
fork(): Cannot allocate memory
Failed to start watchfrr! ... failed!

I checked the available memory using free -m and it shows that I have 10+ GB of available memory.
This is not working on both my Arch Linux computers, I tried on both linux 6.5.8 and linux-lts 6.1.59.
Docker should be configured correctly on my machine, since kathara check works and my user is in the docker group.
This is also not working on my friend's laptop, which is running Fedora.

My previous lab experience with static routing worked flawlessly.

I still need to try this on Windows, but I expect it will work, since it worked for my classmates.

Steps To Reproduce

\

Expected Behavior

\

Check Command Output

❯ kathara check
*	Current Manager is: Docker (Kathara)
*	Manager version is: 24.0.6
*	Python version is: 3.10.10 (main, Mar  5 2023, 22:26:53) [GCC 12.2.1 20230201]
*	Kathara version is: 3.7.0
*	Operating System version is: Linux-6.5.8-arch1-1-x86_64
*	Trying to run `Hello World` container...
Deploying devices...|#############################################################################################| 1/1
*	Container run successfully.
Deleting devices...|##############################################################################################| 1/1
@lorenzo93
Copy link
Member

Hello @BuonHobo,

We're familiar with the issue you mentioned, as it has been addressed here.
Notably, that issue refers to the older /etc/init.d method to initiate services.
Since Kathará now utilizes systemctl, could you verify if the proposed solution is effective in your situation? Simply prepend su before running the service, like this: su systemctl start frr.

@BuonHobo
Copy link
Author

Thank you for your help.

Running su systemctl start frr gave this output:

root@r3:/# su systemctl start frr
su: user systemctl does not exist or the user entry does not contain all the required fields

But this command seems to work as expected:

root@r5:/# su -c "systemctl start frr"
root@r5:/# systemctl status frr
frr.service - FRRouting
    Loaded: loaded (/usr/lib/systemd/system/frr.service, enabled)
    Active: active (running)

Thank you again for your support!
Is there anything I can do to help you find a solution?

@lorenzo93 lorenzo93 self-assigned this Oct 25, 2023
@lorenzo93
Copy link
Member

We already tried to find a solution without any luck.
If you find the real cause of this issue we would be happy to fix it.
In the meantime, I'll write your solution even under the original issue so that if someone have the same problem he could learn the workaround.
We'll keep this issue open until the problem will be fixed.

Thanks for the support :)

@BuonHobo
Copy link
Author

I tried digging around but I haven't found a reason why this happens.

However, there's a simple way to include the workaround in kathara so that users don't have to know about it and can follow the lectures without issues.

It's pretty simple, it only requires adding a file named /etc/systemd/system/frr.service.d/workaround.conf in the kathara image. I tested the fix by adding this file inside each machine in the lab folder.

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. This solution is still a workaround, but it is easy to revert and it makes my machine work as intended.

@tcaiazzi
Copy link
Member

tcaiazzi commented Nov 3, 2023

Hi @BuonHobo,

Many thanks for the help! We really appreciate it, and we will include your workaround in the next release of the kathara/frr image.

I'm closing this issue, since I opened a new one (KatharaFramework/Docker-Images#10) in the Docker images repository. We can continue the discussion there.

Many thanks for the help and support 🚀

@tcaiazzi tcaiazzi closed this as completed Nov 3, 2023
@tcaiazzi tcaiazzi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
@tcaiazzi tcaiazzi closed this as completed Nov 3, 2023
@tcaiazzi tcaiazzi changed the title Can't start frr.service Can't start frr.service (Duplicate) Nov 3, 2023
@tcaiazzi tcaiazzi changed the title Can't start frr.service (Duplicate) Can't start frr.service Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants