Session daemon quitting

Thomas Leonard tal00r at ecs.soton.ac.uk
Sun Apr 11 21:37:10 EST 2004


On Sat, Apr 10, 2004 at 06:40:49PM -0400, Havoc Pennington wrote:
> On Sat, 2004-04-10 at 15:59, Thomas Leonard wrote:
> > BTW, I noticed that the default policy has:
> > 
> >     <!-- Allow everything to be received -->
> > 	<allow eavesdrop="true"/>
> > 
> > This seems to block errors. I had to change it to:
> > 
> >     <!-- Allow everything to be received -->
> > 	<allow eavesdrop="true" requested_reply="false"/>
> > 
> > Otherwise, you don't even get to see the error telling you that the
> > security policy stopped you from seeing the original error, which isn't
> > too friendly... (tested with dbus-send).
> 
> I think this may be just a bug - an error reply should be considered a
> reply and allowed. You'd have to investigate in more detail.

Ah, when I had this problem, I'd forgotten to set type=method_call (but I
was using --print-reply).

dbus_send printed:

	Error: Message did not receive a reply

while the dbus daemon (verbose) prints:

7257: security policy disallowing message due to recipient policy
7257: Sending error reply org.freedesktop.DBus.Error.AccessDenied "A
security policy in place prevents this recipient from receiving this
message from this sender, see message bus configuration file (rejected
message had interface "(unset)" member "(unset)" error name
"net.sf.rox.Session" destination ":1.6" reply serial 2 requested_reply=0)"
7257: Sending (no interface) (no member)
org.freedesktop.DBus.Error.AccessDenied from driver

> > Finally, calling _exit in a client automatically when the dbus daemon dies
> > seems a bit unfriendly. Although we never want the daemon to exit, users
> > should really be able to save their work. I realise this can be disabled,
> > but how many authors will think to change it?
> 
> The reason everything exits when your X session dies is this same policy
> (Xlib calls exit()) - only with Xlib it can't even be disabled.

Well, if it's exit (rather than _exit) then I suppose you can still do a
save in your exit handler. However, losing the X connection is a bit more
serious, because you can't pop up a dialog telling the user to save (using
an atexit() handler is the only real option anyway). However, D-BUS clients
will usually be able to continue at least well enough to save.

(ROX-Session pops up a box if the bus dies, asking the user to save and
log out as soon as possible)

However, for non-X programs it probably still makes sense to exit by
default, as you say, since they could be orphaned. Probably GTK will
change the setting in future when it connects to the bus, so I guess it
shouldn't be changed at the DBUS level anyway.


-- 
Thomas Leonard			http://rox.sourceforge.net
tal00r at ecs.soton.ac.uk	tal197 at users.sourceforge.net
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1



More information about the dbus mailing list