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

configure: Add --with-systemd option #50

Merged
merged 1 commit into from
Jan 18, 2022
Merged

configure: Add --with-systemd option #50

merged 1 commit into from
Jan 18, 2022

Conversation

zdohnal
Copy link
Contributor

@zdohnal zdohnal commented Jan 4, 2022

NEW:

The option gives a way how to disable systemd unit file installation and provides a way how to define a different systemd unit dir.

OLD version:

  • enable possibility to turn off systemd unit file's installation
    (some distitributions can still work without systemd)
  • enable possibility to add a specific path to systemd unit dir
    via UNITDIR variable (if not used, /usr/lib/systemd/system is chosen)
  • install lprint.service into /usr/lib/systemd/system by default -
    /etc/systemd/system is for admin's overrides

Copy link
Owner

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdohnal So I think AC_ARG_WITH (as in --with-systemd[=PATH]) would be more appropriate, and in the makefile the "else" should be changed to an "elif" with the condition that $(unitdir) isn't empty allowing --without-system to be supported.

Also, shouldn't we be using ${libdir}/systemd/... for the default path and not hardcoding to /usr/lib/systemd? It's fine for a system package to put things in /usr but most local/site installs use /usr/local (default prefix) or /opt (FHS).

@zdohnal
Copy link
Contributor Author

zdohnal commented Jan 5, 2022

@zdohnal So I think AC_ARG_WITH (as in --with-systemd[=PATH]) would be more appropriate,

TBH setting the path via configuration option looked as an overkill for me (AFAIK if someone installs systemd, its system service files would lie in /usr/lib/systemd/system), so env variable looked fine for such a corner case.

and in the makefile the "else" should be changed to an "elif" with the condition that $(unitdir) isn't empty allowing --without-system to be supported.

Ah, this one I've missed - that's what I get from switching from one thing to another... thx.

Also, shouldn't we be using ${libdir}/systemd/... for the default path and not hardcoding to /usr/lib/systemd? It's fine for a system package to put things in /usr but most local/site installs use /usr/local (default prefix) or /opt (FHS).

Using ${libdir} would result into /usr/[local/]lib64 on 64b archs and systemd (CUPS does behave in similar way :) ) looks only into /usr/[local/]lib/systemd/system. So we can use the prefix, but not ${libdir} (IIUC).

@zdohnal zdohnal changed the title Systemd related changes configure: Add --with-systemd option Jan 5, 2022
The option enables disabling installation of systemd unit file
or setting a different path for systemd unit file.
Copy link
Owner

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do a little cleanup for cross-compilation, but otherwise LGTM.

@michaelrsweet michaelrsweet self-assigned this Jan 18, 2022
@michaelrsweet michaelrsweet added enhancement New feature or request platform issue Issue is specific to an OS or desktop priority-medium labels Jan 18, 2022
@michaelrsweet michaelrsweet added this to the v1.1.x milestone Jan 18, 2022
@michaelrsweet michaelrsweet linked an issue Jan 18, 2022 that may be closed by this pull request
@michaelrsweet michaelrsweet merged commit e588fba into michaelrsweet:master Jan 18, 2022
@zdohnal
Copy link
Contributor Author

zdohnal commented Jan 18, 2022

Thank you for looking into it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request platform issue Issue is specific to an OS or desktop priority-medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

systemd service file in wrong directory
2 participants