Skip to content

Meson based build creates invalid systemd unit file #1462

@Narrat

Description

@Narrat

Decided to build a new package with the new build system in place.
And after a restart I noticed that dunst won't display anymore.

$ notify-send test
GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer 'org.freedesktop.Notifications': activation request failed: unit is invalid

Looking at the user unit file it contains two exec lines (and both of them are wrong for the generated package):

[Unit]
Description=Dunst notification daemon
Documentation=man:dunst(1)
PartOf=graphical-session.target

[Service]
Type=dbus
BusName=org.freedesktop.Notifications
ExecStart=##PREFIX##/bin/dunst
ExecStart=bin/dunst
Slice=session.slice

So two one issues:

  1. Both lines already there in dunst.systemd.service.in.
    I suppose it is due to keep supporting both build systems? But doesn't help if the unit file gets invalidated

2) If --bindir is unset it should respect the value of --prefix as a fallback (like it is done in the Makefile. Could be circumvented with explicitly setting bindir, but shouldn't be necessary. (And not that much of a problem, as /bin symlinks to /usr/bin, but still?)
Edit: I must have mixed up the files. Looking at the installed user unit file contains the right path to the command

How was it built?

With a PKGBUILD to create a package for an Arch distribution. Essential commands used in said PKGBUILD:

arch-meson ${_pkgname} build
meson compile -C build

arch-meson being a wrapper and setting the following options:

  --prefix        /usr \
  --libexecdir    lib \
  --sbindir       bin \
  --buildtype     plain \
  --auto-features enabled \
  --wrap-mode     nodownload \
  -D              b_pie=true \

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions