Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 908750 - app-emulation/libvirt-9.4.0 installs systemd units that use /etc/conf.d
Summary: app-emulation/libvirt-9.4.0 installs systemd units that use /etc/conf.d
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-06-18 07:34 UTC by Agostino Sarubbo
Modified: 2023-06-18 12:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz (build.log.xz,48.13 KB, application/x-xz)
2023-06-18 07:34 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2023-06-18 07:34:20 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: app-emulation/libvirt-9.4.0 installs systemd units that use /etc/conf.d.
Discovered on: amd64 (internal ref: ci)
Comment 1 Agostino Sarubbo gentoo-dev 2023-06-18 07:34:22 UTC
Created attachment 864112 [details]
build.log.xz

build log and emerge --info (compressed because it exceeds attachment limit, use 'xzless' to read it)
Comment 2 Michal Prívozník 2023-06-18 08:12:45 UTC
This is the warning from the log:

 * QA Notice: systemd units using /etc/conf.d detected:
 * /usr/lib/systemd/system/virtchd.service:EnvironmentFile=-/etc/conf.d/virtchd
 * See: https://wiki.gentoo.org/wiki/Project:Systemd/conf.d_files


and it's because meson is ran as:

  meson setup ... -Dinit_script=systemd ... -Dinitconfdir=/etc/conf.d ...

and libvirt uses initconfdir to generate .service files:

  libvirt.git $ git grep initconfdir
  src/ch/virtchd.service.in:EnvironmentFile=-@initconfdir@/virtchd


So I believe that if we pass '-Dinitconfdir=/etc/systemd' to meson then this warning would be resolved.

Meanwhile, libvirt's own meson.build has some logic for providing sane defaults:

initconfdir = get_option('initconfdir')
if initconfdir == ''
  if (os_release.contains('alpine') or
      os_release.contains('arch') or
      os_release.contains('gentoo'))
    initconfdir = sysconfdir / 'conf.d'
  # Ubuntu has ID_LIKE=debian
  elif os_release.contains('debian')
    initconfdir = sysconfdir / 'default'
  else
    initconfdir = sysconfdir / 'sysconfig'
  endif
endif

where the case for gentoo needs  to be refined. I mean, /etc/conf.d is good for OpenRC but wrong for systemd.
Comment 3 Larry the Git Cow gentoo-dev 2023-06-18 12:56:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9610d99869f591742d96e180e987a95d23b31a0b

commit 9610d99869f591742d96e180e987a95d23b31a0b
Author:     Michal Privoznik <michal.privoznik@gmail.com>
AuthorDate: 2023-06-18 08:27:13 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-06-18 12:56:46 +0000

    app-emulation/libvirt: Fix EnvironmentFile= in systemd units
    
    Libvirt installs systemd unit files with EnvironmentFile= derived
    from initconfdir option passed in the configure phase, e.g.:
    
      src/ch/virtchd.service.in:21:EnvironmentFile=-@initconfdir@/virtchd
    
    And since we explicitly pass:
    
      -Dinitconfdir="${EPREFIX}/etc/conf.d"
    
    this results in systemd unit files using /etc/conf.d/ which is
    discouraged.
    
    Closes: https://bugs.gentoo.org/908750
    Signed-off-by: Michal Privoznik <michal.privoznik@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/31526
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 app-emulation/libvirt/libvirt-9.4.0.ebuild | 2 +-
 app-emulation/libvirt/libvirt-9999.ebuild  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)