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

UDM-Boot-2x_1.0.1 - "Restart-On-Failure" #532

Open
SSJPKXL opened this issue Apr 12, 2023 · 3 comments
Open

UDM-Boot-2x_1.0.1 - "Restart-On-Failure" #532

SSJPKXL opened this issue Apr 12, 2023 · 3 comments

Comments

@SSJPKXL
Copy link

SSJPKXL commented Apr 12, 2023

The latest UDM Boot service DEB package can be found here - https://unifi.boostchicken.io/udm-boot-2x_1.0.1_all.deb and it has an issue with not detecting failures correctly. For example, if you create a custom script to add your own IPTables rules, your rules are going to be re-applied on top of each other at least several times after reboot.

To mitigate the issue, you need to remove the following lines from "\lib\systemd\system\udm-boot.service" after you install the service (DEB package):
Restart=on-failure
RestartSec=5s

Previous UDM Boot service versions didn't include those lines.

@JoeOIVOV
Copy link

JoeOIVOV commented Apr 17, 2023

I didn't see udm-boot.service in "/lib/systemd/system" ,

it was in "/etc/system/systemd" and symlinks to "/etc/system/systemd/multi-user.target.wants/"

@SSJPKXL
Copy link
Author

SSJPKXL commented Apr 18, 2023

When UDM-Boot-2x_1.0.1 DEB package is extracted in Windows, it results in 2 directories, one of which is some user documentation and the other is "\lib\systemd\system\udm-boot.service". That's the one I edited to remove the 2 lines I mentioned. I think others are just symlinks, but not sure...

@lkubb
Copy link

lkubb commented Apr 25, 2023

On a related note, it's a nice practice to ensure your scripts are idempotent, i.e. do not change the state when it's already correct. With iptables, you can check for the existence of a rule by substituting -A for -C:

myrule="PREROUTING -s 10.1.0.0/24 [...]"
iptables -t nat -C ${myrule} || iptables -t nat -A ${myrule}

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

No branches or pull requests

3 participants