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

systemd: d /run/stubby 0750 root stubby - - makes no sense #62

Closed
letoams opened this issue Jan 2, 2018 · 12 comments
Closed

systemd: d /run/stubby 0750 root stubby - - makes no sense #62

letoams opened this issue Jan 2, 2018 · 12 comments
Labels

Comments

@letoams
Copy link

letoams commented Jan 2, 2018

tmpfiles say:

d /run/stubby 0750 root stubby - -

What is the point of /run/stubby in mode 0750 owner root, if stubby is started as user stubby?
It won't be able to write anything in the directory. If there is anything to read there, who places it in that directory (as root even, so not stubby itself)

Why is this directory needed at all?

@bpereto
Copy link

bpereto commented Jan 14, 2018

Because systemd service start fails with error 210/CHROOT until the directory exists.
With the WorkingDirectory=/run/stubby in the service unit

@libreswan
Copy link

Ok, so we can just remove WorkingDir= from the system service file, and remove all the tmpfiles handling

@wtoorop
Copy link
Contributor

wtoorop commented Apr 30, 2018

@dkg @letoams The systemd files were contributed. I suspect mode 0750 was a mistake. Or perhaps having UID root was.

Stubby needs a writeable directory for Zero configuration DNSSEC. Would /run/stubby be suitable for this? (I think it is) If so, I'll update the systemd files and stubby.yml to suggest a configuration like that.

@letoams
Copy link
Author

letoams commented Apr 30, 2018 via email

@ArchangeGabriel
Copy link
Contributor

@wtoorop /var/run/ is a symlink to /run/ on my system. Looking at /run/ content, I think it the stubby folder should be owned by stubby itself.

This folder is supposed to remain empty outside of zero-config DNSSEC anyway. So no PID file here indeed.

@wtoorop We might also want to use this as $HOME for the stubby user btw. Unless you prefer keeping no home folder and fixing appdata_dir in the default config?

@wtoorop
Copy link
Contributor

wtoorop commented May 3, 2018

@ArchangeGabriel Yes, I agree the folder should be owned by user stubby.

I will include a commented out appdata_dir in stubby.yml, because stubby is not always managed by systemd (definitely not on MacOS and Windows, and probably also not on BSDs).
You could do perhaps something like

sed 's/^# appdata_dir:/appdata_dir:/g' stubby.yml.example >etc/stubby/stubby.yml

from the PKGBUILD script?
I'll make a note in the README.md about that setting too.

I don't have a strong preference whether or not to give the system user stubbya home directory.
It feels slightly more secure if it wouldn't have one to me.. What do you think?

@wtoorop
Copy link
Contributor

wtoorop commented May 3, 2018

Done so with commit 862c90b

@ArchangeGabriel
Copy link
Contributor

@wtoorop Sorry for the delay in answering. Does the new systemd service file works if a stubby system user already exists? If you don’t know I’ll have a look later today.

@wtoorop
Copy link
Contributor

wtoorop commented May 11, 2018

Yes, I tested. It will reuse the existing user.

@ArchangeGabriel
Copy link
Contributor

I found it in the doc too. So the current service file is really amazing!

@ArchangeGabriel
Copy link
Contributor

Oh and this issue should be closed now. ;)

@wtoorop
Copy link
Contributor

wtoorop commented May 11, 2018

Thanks :)!

@wtoorop wtoorop closed this as completed May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants