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


View this message in rfc822 format

From: Ulrich Müller <ulm <at> gentoo.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Ulrich Müller <ulm <at> gentoo.org>, schwab <at> linux-m68k.org, 76924 <at> debbugs.gnu.org
Subject: bug#76924: 31.0.50; Wrong install location for systemd user unit file
Date: Wed, 12 Mar 2025 17:36:46 +0100
>>>>> On Wed, 12 Mar 2025, Eli Zaretskii wrote:

>> Presumably the most common use cases will be:
>> 
>> - Distros building an Emacs package. These should make sure that
>>   prefix is the same for all their packages. So, installing in
>>   $(prefix)/lib will be The Right Thing and no option is needed.
>> 
>> - Users compiling Emacs from the release tarball or from Git. For
>>   these we don't really know what the prefix is, it could be
>>   /usr/local or some location under their home dir. I believe an
>>   option would be useful here.
>> 
>>   Not entirely sure about the default, but I'd go with $(prefix)/lib
>>   also for this case, because: a) /usr/local/lib is in systemd's
>>   search path, which covers one of the more common cases, and
>>   b) hardcoded /usr/lib (systemd's prefix) may not be writable for
>>   the user.

> OK, thanks. Before we decide what to do, would it be possibly to see
> what other projects do with systemd files? (Assuming there are other
> projects which install files for systemd's use.) I'd like to be sure
> we are not reinventing the wheel here, if some accepted solution
> already exists.

So I did some reasearch (not at all comprehensive, but should be enough
to get an idea how things are typically done):

blueman:
  configure option --with-systemduserunitdir

GNOME:
  Meson option:
  option('systemduserunitdir', type: 'string', value: '', description: 'custom directory for systemd user units, or \'no\' to disable')

KDE:
  CMake installs into ${KDE_INSTALL_SYSTEMDUSERUNITDIR} which is defined
  by KDE Frameworks' extra-cmake-modules package

XFCE:
  configure.ac defines location based on $(prefix):
  systemd_userdir = $(prefix)/lib/systemd/user

libvirt:
  Meson option (for system unit file):
  option('unitdir', type: 'string', value: '', description: 'directory for systemd unit files')

PAM:
  Meson option (for system unit file):
  option('systemdunitdir', type: 'string', description: 'systemd service directory')


From this, I would conclude:

- Most packages have the location configurable. The only exception in
  above list is XFCE which uses $(prefix)/lib/systemd/user.

- The name of the option isn't standardised, but variations of
  "--with-systemduserunitdir" or "systemduserunitdir" are what I see
  most often.




This bug report was last modified 70 days ago.

Previous Next


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