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

Set restart policy of the anthias-wifi-connect service to on-failure. #1797

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nicomiguelino
Copy link
Contributor

@nicomiguelino nicomiguelino requested a review from a team as a code owner April 13, 2023 20:05
@sonarcloud
Copy link

sonarcloud bot commented Apr 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@nicomiguelino
Copy link
Contributor Author

nicomiguelino commented Apr 13, 2023

@vpetersson, here are the statuses of the services after deploying the changes to my own fleet.

image

I checked the anthias-wifi-connect logs, and it seems that the service is not restarting every boot.
The only time that it was started is when the changes were deployed (for the first time).

Would it be better to start the service every device boot?

@vpetersson
Copy link
Contributor

Would it be better to start the service every device boot?

Yes, if you're able to prevent a restart loop.

@nicomiguelino
Copy link
Contributor Author

Okay, thanks. One drawback of using on-failure is that the service will not start again if it exits with a zero (successful).

It is possible to start anthias-wifi-connect service from the viewer service via the Supervisor API.

@vpetersson
Copy link
Contributor

Okay, thanks. One drawback of using on-failure is that the service will not start again if it exits with a zero (successful).

That's the desired behavior.

It is possible to start anthias-wifi-connect service from the viewer service via the Supervisor API.

That's a good point. However, I'm curious what the behavior is on Raspbian OS. Does it start once per boot, or only once in total?

@nicomiguelino
Copy link
Contributor Author

The behavior in RPi OS is different from that in balenaOS.

In RPi OS, if the restart policy is set to default (no), it will never restart again, unless we'll explicitly start it. I've created a systemd service to start the anthias-wifi-connect service during startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set the restart policy of the anthias-wifi-connect service to on-failure for devices running balenaOS.
2 participants