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

headscale.service location #1359

Closed
zoenglinghou opened this issue Apr 20, 2023 · 10 comments · Fixed by #1391
Closed

headscale.service location #1359

zoenglinghou opened this issue Apr 20, 2023 · 10 comments · Fixed by #1391
Labels
bug Something isn't working

Comments

@zoenglinghou
Copy link

Bug description
headscale.service should not be installed to /etc/systemd/system

To Reproduce

dpkg -L headscale.deb

Context info
It is my understanding that systemd unit files from a package should be installed to /usr/lib/systemd/system, and would be symlinked to /etc/systemd/system upon systemctl enable. Sometimes the postinst and prerm would handle the service enabling and stopping too.

@zoenglinghou zoenglinghou added the bug Something isn't working label Apr 20, 2023
@jonathanspw
Copy link
Contributor

You are correct on this.

@loprima-l
Copy link
Contributor

I guess it depends on the linux version and OS, I'm not so familiar with Linux, did you know how is it on other OSes?

@zoenglinghou
Copy link
Author

I guess it depends on the linux version and OS, I'm not so familiar with Linux, did you know how is it on other OSes?

I know this is the packaging convention on Debian-, RedHat-, and Arch-Families. macOS would use a different init system

@jonathanspw
Copy link
Contributor

It's standard across systemd-based systems. /usr/lib/systemd is for units from packages. /etc/systemd/system is for custom stuff/non-packaged stuff.

In addition to /etc/systemd/system, the drop-in ".d/" directories for system services can be placed in /usr/lib/systemd/system or /run/systemd/system directories. Drop-in files in /etc/ take precedence over those in /run/ which in turn take precedence over those in /usr/lib/. Drop-in files under any of these directories take precedence over unit files wherever located. Multiple drop-in files with different names are applied in lexicographic order, regardless of which of the directories they reside in.

src: https://www.freedesktop.org/software/systemd/man/systemd.unit.html

tldr: it's all about precedence. Use /usr/lib/systemd to allow users to override things if they desire in a clean way.

@loprima-l
Copy link
Contributor

@jonathanspw I think you're already working on the RPM package build, as I'm not familiar with Linux, can you make a pull request for this or at least make the changes on the .rpm ?

@jonathanspw
Copy link
Contributor

It's already correct in the RPMs. PRd to fix the .debs.

@loprima-l
Copy link
Contributor

Oh, I supposed that the error was everywhere, nice job ^^

@loprima-l
Copy link
Contributor

@zoenglinghou You can close your Issue, @jonathanspw Got ya !

@jonathanspw
Copy link
Contributor

When the PR is merged it will close it automatically :)

@zoenglinghou
Copy link
Author

Thanks @jonathanspw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants