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

Use our own prefix to look up systemd user services dir #2388

Closed
wants to merge 1 commit into from

Conversation

ncfavier
Copy link

@ncfavier
Copy link
Author

@fujiwarat is there any problem with this change?

@fujiwarat
Copy link
Member

LGTM.

Could you please add the prefix "configure: " to your patch subject and rebase your patch if you wish to import your signature?

@ncfavier
Copy link
Author

Done

@fujiwarat
Copy link
Member

Sorry, thinking about this patch again, I think this patch has a problem.
If system's prefix is /usr and ibus's prefix is /opt, the service files will be installed in /opt/lib/systemd/user

Why don't you fix systemduserunitdir in systemd.pc?
https://github.com/systemd/systemd/blob/main/src/core/systemd.pc.in

Seems you wish to install the service files in /lib/systemd/user so I think ${libdir} is better than ${prefix}/lib in systemd.pc ?
/lib is symlink of /usr/lib in Fedora.

@ncfavier
Copy link
Author

ncfavier commented Jun 2, 2022

If system's prefix is /usr and ibus's prefix is /opt, the service files will be installed in /opt/lib/systemd/user

I don't think that's a real life problem. It seems to be the way /opt is intended to be used ("Generally, all data required to support a package on a system must be present within /opt/<package>"). If the user wants systemd to use those unit files, they'd have to copy/link them to a location systemd knows about.

In NixOS we want to install the unit files in $ibus/lib/systemd/user, where ibus=/nix/store/...-ibus. By default they would go in $systemd/lib/systemd/user, where systemd=/nix/store/...-systemd, so the proposed solution is to replace systemd's prefix $systemd with ibus' prefix $ibus.

I'm not sure how $libdir would solve that?

@fujiwarat
Copy link
Member

fujiwarat commented Jun 2, 2022

I mean the systemd.pc.in would be:

libdir=@libdir@
systemduserunitdir=${libdir}/systemd/user

And the systemd.pc could be built with the configure file.

@fujiwarat
Copy link
Member

E.g. ibus/engine/Makefile.am indicates $(XKBCONFIG_BASE) to find the directory from xkeyboard-config.pc
And ibus/autogen.sh can run without --prefix=/usr option against /usr/local

@jtojnar
Copy link

jtojnar commented Jun 2, 2022

If ibus is installed to /usr/local, I would expect the systemd unit to be installed under /usr/local too, so that is another argument in favour of this. And systemd supports that.

@fujiwarat
Copy link
Member

OK, thank you for the explanation.
Now the patch sounds good with me.
I will integrate the patch tomorrow.

@fujiwarat
Copy link
Member

Thank you for the patch.
I forgot to ask to add BUG= lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants