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

etc: add hnsd systemd service #18

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tuxcanfly
Copy link
Contributor

WIP: looking for feedback to improve defaults, conflicts with other resolvers, tests on various linux distros etc.

etc/hnsd.service Outdated Show resolved Hide resolved
@tuxcanfly
Copy link
Contributor Author

So I don't think the config file is actually being parsed. Instead what I've done is pass the config options as command line params through the use of EnvironmentFile directive in systemd service.

@tynes
Copy link

tynes commented Sep 18, 2019

Since hnsd.conf is no longer being parsed as a config file, should it be renamed to something like hnsd.env and have each of the possible environment variables in it but commented out? We would also need to add the environment variable parsing to hnsd for this to work.

AmbientCapabilities=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE
EnvironmentFile=/etc/hnsd.conf
ExecStart=/usr/bin/hnsd $HNSD_CONFIG
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you planning on removing $HNSD_CONFIG?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, its injected from /etc/hnsd.conf. It's a bit of hack to resemble a configuration file, but all it does is set the env var that gets passed to the executable.

This is only necessary since we don't have config parsing as of yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just recommend that flags be used and a sane default be put in the service file.

eg:

hnsd -r 127.0.0.1:53

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.

4 participants