-
Notifications
You must be signed in to change notification settings - Fork 189
Makefile: hardcode systemd unit installation path #329
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
Conversation
|
@cyrillkuettel can you test this? |
Makefile
Outdated
| BINDIR ?= $(PREFIX)/bin | ||
| MANDIR ?= $(PREFIX)/share/man | ||
| MAN1DIR ?= $(MANDIR)/man1 | ||
| SYSCONFDIR ?= $(PREFIX)/etc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also change this back to just "/etc" ? It's a little confusing if the config file earlyoom.default is not stored in /etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If earlyoom.default is meant to be read by earlyoom main program, then this file and the main program should point to the same PREFIX, e.g. /usr/local.
The systemd service is meant to be read by the external systemd, therefore it will be put in another location not necessarily equal to the PREFIX of earlyoom - usually /etc/systemd/system/.
Is there anything wrong with the above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, earlyoom.default is read by systemd, here: https://github.com/rfjakob/earlyoom/blob/master/earlyoom.service.in#L6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the Makefile deals with SYSCONFIDIR in other places:
Line 52 in 04e93de
| sed "s|:TARGET:|$(BINDIR)|g;s|:SYSCONFDIR:|$(SYSCONFDIR)|g" $< > $@ |
But let's do as you suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it will work, but I find it confusing to have the config file for /etc/systemd/system/earlyoom.service in /usr/local . Thanks!
The path can't be relative to PREFIX, because of systemd. Sources: - systemd/systemd#19414 - https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html
The path can't be relative to PREFIX.
This is how things work with systemd...
Sources:
Closes #327