Bug 1267609

Summary: service messagebus restart breaks various stuff
Product: Red Hat Enterprise Linux 7 Reporter: Karel Srot <ksrot>
Component: systemdAssignee: systemd-maint
Status: CLOSED CANTFIX QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: high    
Version: 7.1CC: lnykryn, systemd-maint-list, systemd-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-30 16:15:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Karel Srot 2015-09-30 14:04:40 UTC
Description of problem:

Accidentally I have encountered that after 
  service messagebus restart
things doesn't work as properly as before.

Most significant change is some timeout that happens during a login and delays each login or su operation. Beside that, this change also prevented me to log in to an openstack virtual system since the connection timed out after ~2 minutes and couldn't be re-established. Also, bug 1249627 could be related.

As both polkit and dbus didn't change in 7.2 I suppose this is due to systemd.

Very easy to reproduce:

[root@x86-64-v08 ~]# rpm -q kernel systemd dbus
kernel-3.10.0-319.el7.x86_64
systemd-219-16.el7.x86_64
dbus-1.6.12-13.el7.x86_64

[root@x86-64-v08 ~]# systemctl status > /tmp/pre

[root@x86-64-v08 ~]# time su - tester -c id
uid=1001(tester) gid=1001(tester) groups=1001(tester) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

real	0m0.230s
user	0m0.068s
sys	0m0.091s

[root@x86-64-v08 ~]# service messagebus restart
Redirecting to /bin/systemctl restart  messagebus.service
PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.
[root@x86-64-v08 ~]# sleep 3
[root@x86-64-v08 ~]# systemctl status > /tmp/post

[root@x86-64-v08 ~]# time su - tester -c id
uid=1001(tester) gid=1001(tester) groups=1001(tester) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

real	0m25.172s
user	0m0.058s
sys	0m0.112s

[root@x86-64-v08 ~]# tail /var/log/messages
Sep 30 15:59:38 x86-64-v08 systemd: Unit tuned.service entered failed state.
Sep 30 15:59:38 x86-64-v08 systemd: tuned.service failed.
Sep 30 15:59:38 x86-64-v08 systemd: Started D-Bus System Message Bus.
Sep 30 15:59:39 x86-64-v08 systemd: Starting D-Bus System Message Bus...
Sep 30 15:59:53 x86-64-v08 su: (to tester) root on pts/1
Sep 30 15:59:53 x86-64-v08 dbus[2217]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesktop.login1.service'
Sep 30 15:59:53 x86-64-v08 systemd: Started Login Service.
Sep 30 15:59:53 x86-64-v08 dbus-daemon: dbus[2217]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesktop.login1.service'
Sep 30 16:00:18 x86-64-v08 dbus[2217]: [system] Failed to activate service 'org.freedesktop.login1': timed out
Sep 30 16:00:18 x86-64-v08 dbus-daemon: dbus[2217]: [system] Failed to activate service 'org.freedesktop.login1': timed out

[root@x86-64-v08 ~]# diff /tmp/pre /tmp/post
2c2
<     State: running
---
>     State: degraded
4,5c4,5
<    Failed: 0 units
<     Since: Wed 2015-09-30 15:56:25 CEST; 2min 48s ago
---
>    Failed: 2 units
>     Since: Wed 2015-09-30 15:56:25 CEST; 3min 24s ago
13c13
<            │   │ └─2175 systemctl status
---
>            │   │ └─2220 systemctl status
17a18,19
>              ├─dbus.service
>              │ └─2217 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
31,32d32
<              ├─tuned.service
<              │ └─878 /usr/bin/python -Es /usr/sbin/tuned -l -P
41,44d40
<              ├─polkit.service
<              │ └─617 /usr/lib/polkit-1/polkitd --no-debug
<              ├─wpa_supplicant.service
<              │ └─616 /usr/sbin/wpa_supplicant -u -f /var/log/wpa_supplicant.log -c /etc/wpa_supplicant/wpa_supplicant.conf -u -f /var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid
51,52d46
<              ├─dbus.service
<              │ └─579 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
54d47
<              │ ├─577 /usr/sbin/NetworkManager --no-daemon

Comment 2 Lukáš Nykrýn 2015-09-30 16:15:28 UTC
You can't restart dbus, it will kill the machine. Only change between 7.1 and 7.2 is that logind segfaulted on 7.1 so it looked like it is working.