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

acme-dns needs directory permissions in systemd (documentation) #88

Open
jvanasco opened this issue May 31, 2018 · 6 comments
Open

acme-dns needs directory permissions in systemd (documentation) #88

jvanasco opened this issue May 31, 2018 · 6 comments

Comments

@jvanasco
Copy link
Contributor

jvanasco commented May 31, 2018

I updated my install to control acme-dns via systemd, with an acme-dns user.

I changed the ownership of items in /etc/acme-dns to acme-dns.

If the /etc/acme-dns directory is owned by root, there are errors in accessing the existing database /etc/acme-dns/acme-dns.db. If the directory is owned by acme-dns, the db is read fine.

Stated differently,

# this results in db errors
chown acme-dns:acme-dns /etc/acme-dns/* 

# this works
chown -R acme-dns:acme-dns /etc/acme-dns

I'm not sure how/why this is happing, but I think it is due to sqlite not being able to make lock files.

@joohoi
Copy link
Owner

joohoi commented May 31, 2018

Thanks for bringing this up! I'll investigate a bit, but it looks like we should make slight modifications to the documentation. Pinging @gabe565 as they contributed the systemd service file and docs.

@gabe565
Copy link
Contributor

gabe565 commented May 31, 2018

I honestly forgot that this is configurable. In my setup, I have the /etc/acme-dns directory as owned by root, then have the database in /var/lib/acme-dns and have it owned by acme-dns with 600 permissions. I will PR another step with that setup.

@jvanasco
Copy link
Contributor Author

jvanasco commented May 31, 2018

after some testing * checking the sqlite docs regarding locks, the issue is definitely due to the acme-dns user needing write permissions for the directory which the database file is in.

@gabe565
Copy link
Contributor

gabe565 commented Jun 1, 2018

Yes that's what it looks like, which is why I would rather keep the database in /var/lib/acme-dns since the acme-dns user is guaranteed to own that directory (It's the acme-dns home directory), then a directory in /etc does not have to be writable. Does that seem right?

@jvanasco
Copy link
Contributor Author

jvanasco commented Jun 1, 2018

yeah that seems like the right approach.

if you wanted to overcomplicate things, have you considered playing the config file in there? then a user could just be added to the acme-dns group for edit privileges.

@Ajedi32
Copy link
Contributor

Ajedi32 commented Jun 1, 2018

Yeah, you don't want to put databases in /etc anyway. /etc on Linux is for config files. /var is more appropriate for databases. See http://www.pathname.com/fhs/pub/fhs-2.3.html

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

4 participants