Skip to content

Respect install prefix when installing systemd service file.#12

Open
vogr wants to merge 2 commits into
Mellanox:masterfrom
vogr:master
Open

Respect install prefix when installing systemd service file.#12
vogr wants to merge 2 commits into
Mellanox:masterfrom
vogr:master

Conversation

@vogr

@vogr vogr commented Aug 4, 2023

Copy link
Copy Markdown

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

vogr commented Aug 4, 2023

Copy link
Copy Markdown
Author

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