#986405 dunst: After system boot, dunst.service is resolved to failed state until first notification is issued

Package:
dunst
Source:
dunst
Description:
dmenu-ish notification-daemon
Submitter:
manuel
Date:
2021-04-05 10:51:04 UTC
Severity:
normal
#986405#5
Date:
2021-04-05 10:38:14 UTC
From:
To:
Hi,

I have experienced the following minor problem for a long time:

Every time after booting up my system (Debian Testing with i3 as desktop)
dunst.service is resolved to failed state:

$ systemctl --user status dunst.service
● dunst.service - Dunst notification daemon
     Loaded: loaded (/usr/lib/systemd/user/dunst.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-04-05 11:52:53 EEST; 1min 31s ago
       Docs: man:dunst(1)
    Process: 1534 ExecStart=/usr/bin/dunst (code=exited, status=1/FAILURE)
   Main PID: 1534 (code=exited, status=1/FAILURE)
        CPU: 28ms

Apr 05 11:52:53 hecate systemd[1514]: Starting Dunst notification daemon...
Apr 05 11:52:53 hecate dunst[1534]: CRITICAL: Cannot open X11 display.
Apr 05 11:52:53 hecate systemd[1514]: dunst.service: Main process exited, code=exited, status=1/FAILURE
Apr 05 11:52:53 hecate systemd[1514]: dunst.service: Failed with result 'exit-code'.
Apr 05 11:52:53 hecate systemd[1514]: Failed to start Dunst notification daemon.


Upon issuing a notification (the notification is shown in the desktop correctly)
dunst.service is again resolved active:

$ notify-send "foobar"

$ systemctl --user status dunst.service
● dunst.service - Dunst notification daemon
     Loaded: loaded (/usr/lib/systemd/user/dunst.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-04-05 11:59:37 EEST; 2s ago
       Docs: man:dunst(1)
   Main PID: 6750 (dunst)
      Tasks: 4 (limit: 18703)
     Memory: 4.4M
        CPU: 32ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/dunst.service
             └─6750 /usr/bin/dunst

Apr 05 11:59:37 hecate systemd[1514]: Starting Dunst notification daemon...
Apr 05 11:59:37 hecate dunst[6750]: WARNING: Unknown keyboard shortcut: 'ctrl+grave'
Apr 05 11:59:37 hecate systemd[1514]: Started Dunst notification daemon.
Apr 05 11:59:37 hecate dunst[6750]: WARNING: No icon found in path: 'dialog-information'


I expected the service to be active after boot.

My dunst.service:

$ systemctl --user cat dunst.service
# /usr/lib/systemd/user/dunst.service
[Unit]
Description=Dunst notification daemon
Documentation=man:dunst(1)
PartOf=graphical-session.target

[Service]
Type=dbus
BusName=org.freedesktop.Notifications
ExecStart=/usr/bin/dunst

For completeness, this bug was reported upstream (by myself):

https://github.com/dunst-project/dunst/issues/314#issuecomment-601228703

I file it here as the problem has not been solved and is pointed to be elsewhere.
Quote Github user smcv: