Subject: Re: bug#76924: 31.0.50; Wrong install location for systemd user unit file

From: Eli Zaretskii <[email-masked]>
Date: Tue, 11 Mar 2025 19:22:06 +0200

> From: Ulrich Müller <[email-masked]>
> Cc: Ulrich Müller <[email-masked]>,  [email-masked]
> Date: Tue, 11 Mar 2025 15:38:25 +0100
> 
> >>>>> On Tue, 11 Mar 2025, Eli Zaretskii wrote:
> 
> >> Maybe the cleanest solution would be to ask pkg-config (after all,
> >> systemd must find these files), with $(prefix)/lib/systemd/user as
> >> fallback location.
> 
> > SGTM, thanks.
> 
> Sorry, I had a thinko there. Asking pkg-config isn't such a good idea.
> Imagine someone installing with prefix=/usr/local, we would then install
> the unit file in a stray location outside prefix.

Sorry, I don't understand: if prefix=/usr/local, then
$(prefix)/lib/systemd/user gives us /usr/local/lib/systemd/user, which
is what you wanted, no?  Or what did I miss?

> It is even worse for non-root installs where the dir may not even be
> writable.

For these, we could ask users to use --with-systemduserunitdir.  But
"normal" installs should not need to specify standard directories.