GNU bug report logs - #76924
31.0.50; Wrong install location for systemd user unit file

Previous Next

Package: emacs;

Reported by: Ulrich Müller <ulm <at> gentoo.org>

Date: Mon, 10 Mar 2025 18:57:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Ulrich Müller <ulm <at> gentoo.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 76924 <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Müller <ulm <at> gentoo.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Ulrich Müller <ulm <at> gentoo.org>, 76924 <at> debbugs.gnu.org
Subject: Re: bug#76924: 31.0.50; Wrong install location for systemd user
 unit file
Date: Tue, 11 Mar 2025 14:34:20 +0100
>>>>> On Tue, 11 Mar 2025, Eli Zaretskii wrote:

> The comment there says:

>   # Where the etc/emacs.service file is to be installed.
>   # The system value (typically /usr/lib/systemd/user) can be
>   # obtained with: pkg-config --variable=systemduserunitdir systemd
>   # but that does not respect configure's prefix.
>   # It is not clear where we should install this file when
>   # prefix != /usr (or /usr/local?) (eg for non-root installs).
>   # Other options include ~/.config/systemd/user/,
>   # $XDG_RUNTIME_DIR/systemd/user/
>   # It seems the user may end up having to make a manual link...
>   systemdunitdir=$(libdir)/systemd/user

> So this isn't a simple mistake, but a deliberate decision.  We should
> do more research before we override this.  For example: what do
> distros do with this? do they really all use what you suggest?

Gentoo removes the emacs.service file from Emacs' install image and
installs it in /usr/lib/systemd/user instead.

IIUC Debian installs system unit files in the /lib/systemd/system
directory, see https://wiki.debian.org/systemd. The article doesn't
mention user files, but the corresponding location would be
/lib/systemd/user (i.e. _not_ /lib64).

(Note that systemd no longer supports the concept of separate /lib and
/usr/lib, i.e. /lib is a symlink to /usr/lib and it doesn't matter if
the prefix is / or /usr.)

> Or maybe we should use pkg-config, at least if no --prefix was
> specified at configure time?

systemd.pc has this
(https://github.com/systemd/systemd/blob/cd20d48c69f9e586de914e1facf33b11122477ae/src/core/systemd.pc.in#L34):

   systemd_user_unit_dir=${prefix}/lib/systemd/user
   systemduserunitdir=${systemd_user_unit_dir}

So depending on the prefix, that would be /lib or /usr/lib (which are
equivalent, see above).

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.




This bug report was last modified 69 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.