[GH-ISSUE #88] acme-dns needs directory permissions in systemd (documentation) #35

Open
opened 2026-03-13 15:27:29 +03:00 by kerem · 6 comments
Owner

Originally created by @jvanasco on GitHub (May 31, 2018).
Original GitHub issue: https://github.com/acme-dns/acme-dns/issues/88

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.

Originally created by @jvanasco on GitHub (May 31, 2018). Original GitHub issue: https://github.com/acme-dns/acme-dns/issues/88 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.
Author
Owner

@joohoi commented on GitHub (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.

<!-- gh-comment-id:393688048 --> @joohoi commented on GitHub (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.
Author
Owner

@gabe565 commented on GitHub (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.

<!-- gh-comment-id:393706364 --> @gabe565 commented on GitHub (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.
Author
Owner

@jvanasco commented on GitHub (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.

<!-- gh-comment-id:393707253 --> @jvanasco commented on GitHub (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.
Author
Owner

@gabe565 commented on GitHub (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?

<!-- gh-comment-id:393901290 --> @gabe565 commented on GitHub (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?
Author
Owner

@jvanasco commented on GitHub (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.

<!-- gh-comment-id:393969875 --> @jvanasco commented on GitHub (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.
Author
Owner

@Ajedi32 commented on GitHub (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

<!-- gh-comment-id:394006913 --> @Ajedi32 commented on GitHub (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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/acme-dns#35
No description provided.