I have been able to reproduce those missing signals most reliably within
a systemd user session (for the system session it works most of the
time):

Steps to reproduce missing dbus signals with Ubuntu 16.10 Desktop:

Create a ~/.config/systemd/user/terminal.service with this content:

[Unit]
Description=example unit to open a terminal

[Service]
Environment=DISPLAY=:0
ExecStart=/usr/bin/xterm
SuccessExitStatus=0 15

[Install]
WantedBy=default.target

Open two terminals. In the first one execute the attached
test_systemd_signals.py (which looks for PropertiesChanged Signals):

$ python test_systemd_signals.py

To see all dbus messages during the test you can run "dbus-monitor
--session" in another terminal.

In a second terminal start/stop the systemd unit:
$ systemctl --user daemon-reload
$ systemctl --user start terminal.service
$ systemctl --user stop terminal.service

With the current systemd package 231-9git1 the test script only shows two 
status changes (PropertiesChanged signals) sent by systemd:
ActiveState: active SubState: running
ActiveState: deactivating SubState: stop-sigterm

With the patched systemd package the test script should show the last change of 
the unit status (being set to inactive), too:
ActiveState: active SubState: running
ActiveState: deactivating SubState: stop-sigterm
ActiveState: inactive SubState: dead

Ubuntu 16.04 Desktop does not start a systemd user session by default - I 
created a package (based on https://github.com/joukewitteveen/xlogin) to 
simplify the process:
$ sudo add-apt-repository ppa:seahawk1986-hotmail/xlogin
$ sudo apt-get update
$ sudo apt-get install xlogin openbox

Create a ~/.xinitrc with this content (and make it executable):

#!/bin/bash
exec openbox-session

Then change to a tty console (or use a remote login via ssh):
$ sudo systemctl stop lightdm
$ sudo systemctl start xlogin@user # replace "user" with an existing user name

Now you can open two terminals (a right click on the desktop opens the
openbox menu) and follow the steps for Ubuntu 16.10 above.

** Attachment added: "test_systemd_signals.py"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1632964/+attachment/4762145/+files/test_systemd_signals.py

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1632964

Title:
  Regression: systemd does not send all queued DBus Signals when a unit
  gets inactive

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1632964/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to