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

Another inithook tweak #16

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

Conversation

JedMeister
Copy link
Member

@JedMeister JedMeister commented Nov 19, 2024

  • Ensure that /etc/wireguard/wg0.conf exists - initialisation fails unless it exists; empty file is fine.
    • Note that wg0.conf should always exist when the inithook runs, but it's best to not expect things to be "as they should be"!
  • Fix broken error message if wireguard-server-init.sh fails - cmd is string and should be passing proc.stderr

@JedMeister
Copy link
Member Author

@OnGle

Following our offline discussion & your concerns, I have tested this more thoroughly and had a "proper" look at wireguard-server-init.sh.

I'm happy to give you more details, but the TL;DR is that beyond the error message fix, the other change I made addresses a highly unlikely - perhaps even impossible - edge case. It would only occur if the /etc/wireguard/wg0.conf had been removed after boot. If it did not exist at boot, the wg0 service would fail to start and the wg0 interface could not be up - so wg show interfaces would not list it. So that change - i.e. touching the conf file it if it does not exist - is of little to no value. OTOH touching the conf file would make no significant difference as wireguard-server-init.sh would overwrite the conf file anyway...

So the error message fix should be applied, but the other change probably should just be removed as it's cruft...

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.

1 participant