#770401 needrestart: why does it always suggest restarting dbus

#770401#5
Date:
2014-11-20 23:38:28 UTC
From:
To:
This shows (lately) up at _any_ package upgrade:

,----
| Daemons using outdated libraries
| --------------------------------
|
|
|   1. dbus
|
| (Enter the items you want to select, separated by spaces.)
|
| Which services should be restarted?
`----

Why?

#770401#10
Date:
2014-11-21 06:15:58 UTC
From:
To:
tag 770401 upstream
severity 770401 minor
thanks


Hi Christian,

could you please show the output of `needrestart -v`? Did you try to
restart dbus via needrestart?


HTH & TIA,
Thomas

#770401#19
Date:
2014-11-21 17:06:42 UTC
From:
To:
Sure.  Attached, output from:

	# yes N | needrestart -v >/tmp/needrestart-v 2>&1

which ends with:

	Running kernel seems to be up-to-date.
	No services required to be restarted.

Though, if I run:

	# needrestart -v

it ends with:

	Running kernel seems to be up-to-date.
	Services to be restarted:
	Restart dbus? [yNas]


Cheers,

#770401#24
Date:
2014-11-22 09:55:55 UTC
From:
To:
Please ignore the previous attachment.

A more recent output (after this morning upgrade), attached.  This
time, both:

	# yes N | needrestart -v >/tmp/needrestart-v 2>&1

and:

	# needrestart -v

seem to produce identical output.  Last lines:

	Running kernel seems to be up-to-date.
	Services to be restarted:
	Restart dbus? [yNas]


Cheers,

#770401#29
Date:
2014-11-22 17:15:55 UTC
From:
To:
Hi Christian,

Why dbus is always proposed to be restarted:

I assume pid#13323 (dbus-daemon) runs under your logged-in user. Since
it seems that dbus-daemon is not part of your session needrestart tries
to find a runlevel script to restart it. While looking at the package
content of dbus (after finding it by a dpkg -S /usr/bin/dbus-daemon
call) needrestart finds dbus's rc script and suggests to restart it.


Howto fix / workaround:

Not that easy. needrestart 1.2 did not try to identify processes of user
sessions to distinguish them from processes spawned by system services.
You could add an ignore statement to needrestarts config - but this
would hide any required restarts of the system bus.


I see no way to fix this behavior for jessie. It should be easyly
fixable in needrestart 2.0 due to it's user session handling.


HTH,
Thomas

#770401#34
Date:
2014-11-22 20:58:42 UTC
From:
To:
Yes.  This is what I find in the process list:

	...
	me       13322  0.0  0.0  24484  1292 pts/11   S    Nov08   0:00 /usr/bin/dbus-launch --autolaunch a379e709c99a28d4553793d3510d5297 --binary-syntax --close-stderr
	me       13323  0.0  0.0  42244  1884 ?        Ss   Nov08   0:15 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
	...
	me       15133  0.0  0.0 337604  2904 ?        Sl   Nov09   0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher
	me       15137  0.0  0.0  42108  2476 ?        S    Nov09   0:01  \_ /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
	...
	message+ 32351  0.0  0.0  42240  2596 ?        Ss   Nov21   0:00 /usr/bin/dbus-daemon --system

The WM is wmaker and init is sysv.

Right.  I don't want to do that.

No worries.  This is unstable.

But that worries me a bit, given my setup (sysvinit and wmaker).
Still, I have to admit, I'm not a "session handling" connoisseur.

#770401#39
Date:
2014-11-25 18:27:20 UTC
From:
To:
Now, wait a second...  Why would this bug be considered "minor", as
even if I upgrade dbus-packages dbus is missing from suggested
"restart" list?

,----
| The following packages will be upgraded:
|   libdbus-1-3 libdbus-1-3:i386 ...
`----

,----
| Daemons using outdated libraries
| --------------------------------
|
|
|   1. apache2    4. cron  7. distcc      10. privoxy
|   2. cgmanager  5. cups  8. irqbalance  11. ssh
|   3. cgproxy    6. dbus  9. libvirtd    12. sysv init
|
| (Enter the items you want to select, separated by spaces.)
|
| Which services should be restarted? 1 2 3 4 5 7 8 9 10 11 12
`----

,----
| The following packages will be upgraded:
|   dbus dbus-x11
`----

,----
| Setting up dbus (1.8.12-1) ...
| [ ok ] system message bus already started; not starting..
| Setting up dbus-x11 (1.8.12-1) ...
`----


Cheers,

#770401#44
Date:
2014-11-25 18:55:14 UTC
From:
To:
Re,

The bug handles the "why does it always suggest restarting dbus" issue.
Although the bug is annyoing it doesn't limit the detection of pending
service restarts.

This would be another bug... but I'm a little bit confused:
                     ^^^^^^^
dbus seems to be detected, doesn't it?


HTH,
Thomas

#770401#49
Date:
2014-11-25 19:06:11 UTC
From:
To:
Sure...

Me too...

...but missing from the restart list, as I would have expected, as I
actively upgrade dbus.


Cheers,

#770401#54
Date:
2014-11-25 19:39:29 UTC
From:
To:
Re,

sorry I didn't get it, yet.


 >>> | Which services should be restarted? 1 2 3 4 5 7 8 9 10 11 12

This list misses option 6 intentionally since restarting dbus usually
kills any running display manager sessions.

Service restarts which are killing user sessions or being some more
desruptive are listed but not preselected in debconf ("greylisted").


Cheers,
Thomas

#770401#59
Date:
2014-11-25 21:42:48 UTC
From:
To:
Doesn't kill the one I use (wmaker).

Sure, but there are DMs and DMs.  Which DMs/user sessions are affected
by dbus restarts?

#770401#64
Date:
2014-11-25 21:50:23 UTC
From:
To:
Re,

it seems to be triggered by systemd (see also #770937). It might be
independant of the used DM and since you're using Sys-V init you are not
affected.


Regards,
Thomas

#770401#69
Date:
2014-11-25 22:13:01 UTC
From:
To:
So, restarting dbus affects certain DMs (not all) if init is systemd.
Is that correct?  Is there a way out of that?

I'm not "affected", as, I think, I'm aware of what's going on, but is
it reasonable?


Cheers,