xfce4-notifyd fails to start on displays other than :0

Bug #1898858 reported by Simon Tatham
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xfce4-notifyd (Ubuntu)
New
Undecided
Unassigned

Bug Description

I work remotely by running an XFCE session inside an X display created by vnc4server. On Ubuntu xenial, this causes xfce4-notifyd to fail to start up.

A transcript of my VNC startup script and the results:

simon@xenial:~$ cat ~/.vnc/xstartup
#!/bin/sh
exec setsid xfce4-session
simon@xenial:~$ vncserver :1

New 'xenial:1 (simon)' desktop is xenial:1

Starting applications specified in /home/simon/.vnc/xstartup
Log file is /home/simon/.vnc/xenial:1.log

simon@xenial:~$ ps xf | grep xfce4-notifyd
 4017 pts/0 S+ 0:00 \_ grep --color=auto xfce4-notifyd
simon@xenial:~$ systemctl --user status xfce4-notifyd.service
● xfce4-notifyd.service - XFCE notifications service
   Loaded: loaded (/usr/lib/systemd/user/xfce4-notifyd.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2020-10-07 11:29:41 BST; 27s ago
  Process: 3943 ExecStart=/usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd (code=exited, status
 Main PID: 3943 (code=exited, status=1/FAILURE)

Oct 07 11:29:41 xenial systemd[3794]: Starting XFCE notifications service...
Oct 07 11:29:41 xenial xfce4-notifyd[3943]: Unable to init server: Could not connect: Connection ref
Oct 07 11:29:41 xenial xfce4-notifyd[3943]: cannot open display:
Oct 07 11:29:41 xenial systemd[3794]: xfce4-notifyd.service: Main process exited, code=exited, statu
Oct 07 11:29:41 xenial systemd[3794]: xfce4-notifyd.service: Failed with result 'exit-code'.
Oct 07 11:29:41 xenial systemd[3794]: Failed to start XFCE notifications service.
simon@xenial:~$ exit

If I manually edit /usr/lib/systemd/user/xfce4-notifyd.service so that it adds "--display :1" to the command line, then xfce4-notifyd starts up correctly. (But obviously this is a horrible bodge that I only did temporarily for diagnostic purposes :-)

So I conjecture that the X display parameter is somehow not finding its way to xfce4-notifyd during startup, and that in the normal case nobody notices because xfce4-notifyd defaults to trying to connect to :0.

System details: this can be reproduced on a clean, freshly installed xubuntu 18.04 system (in a test VM, installed on 2020-10-07). The only configuration I performed was to edit my ~/.vnc/xstartup so that it runs xfce4-session (as shown in the transcript above).

simon@xenial:~$ lsb_release -rd
Description: Ubuntu 18.04 LTS
Release: 18.04
simon@xenial:~$ apt-cache policy xfce4-notifyd
xfce4-notifyd:
  Installed: 0.4.2-0ubuntu2
  Candidate: 0.4.2-0ubuntu2
  Version table:
 *** 0.4.2-0ubuntu2 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Simon Tatham (sgtatham) wrote :

Now I think about it harder, I suppose I should mention a few more details.

On the test VM I spun up for the reproducer, I was doing all of this by logging in on a text virtual console. On the real machine where I had this problem originally, I'm doing remote working by SSHing in, running vncserver to start up the X session, and then connecting a VNC client to it.

So, in both cases, the user-level systemd process is already running *before* I set up the new X display. I wouldn't be surprised if that was a key part of the problem: if you logged in on a display other than :0 via a normal display manager, it might well have set DISPLAY before even starting "systemd --user", and then everything might work. (But I haven't tried it.)

Also, when I say "vncserver", that's the one from the "vnc4server" package. (I think that is probably not critical to the behaviour, but just in case.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.