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

Respect install prefix when installing systemd service file. #12

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

Conversation

vogr
Copy link

@vogr vogr commented Aug 4, 2023

Fixes #11.

When using relative paths in the install directive (docs):

If a relative path is given it is interpreted relative to the value of the CMAKE_INSTALL_PREFIX variable.

When no prefix is given, the default is /usr/local, so the service file would end up at /usr/local/lib/systemd/system. This is the right directory for files installed by the administrator according to the systemd docs.

This doesn't work for local installs because systemd expects the service file in $HOME/.local/share/systemd/user and not $HOME/.local/lib/systemd/system ... But since the daemon expects to run as root anyway, this is not a big problem here.

Thank you in advance!

@vogr
Copy link
Author

vogr commented Aug 4, 2023

I realized that /usr/bin/ibarr was hard-coded in the service file: I made a second commit to use the CMAKE_INSTALL_PREFIX there too. This works even for installs with a staging directory as described in the issue.

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.

Installation of systemd service file does not respect install prefix
1 participant