Re: system dbus and Desktop notifications

On Mon, Jun 23, 2014 at 11:38:43AM +0100, Simon McVittie wrote:
On 22/06/14 19:31, Rolf Fokkens wrote:
For a udev driven backup script (connect the USB the disk, and the
backup starts) I'd like to have desktop notifications that say when the
backup starts and when the backup is finished so users can disconnect
the USB disk.

Consider, for instance:

* Alice is a sysadmin, Bob is an unprivileged user. Alice is logged-in
  locally, Bob is logged-in remotely. Who should be notified?
  (I think "Alice but not Bob".)

* The same users, but now Alice is remote and Bob is local. Who should
  be notified? (I'm not sure.)

If you think the answer to the second is "Bob, because, most likely,
he's the one physically plugging in the USB disk" then something at the
level of gvfs (running inside Bob's session) might be a better solution.

If you think the answer to the second is "Alice, because she's the
sysadmin" then the Unix syslog, or the systemd Journal that extends and
partially supersedes syslog on systemd systems, might be a good basis
for an answer.
Something similar has been requested for SMART messages [1]. The
implementation should be quite similar.



Google is helpful, but seems to tell me that these notifications work
via the session dbus, not the system dbus. Apparently a solution is to
identfy any logged on user, find the related DBUS_SESSION_BUS_ADDRESS
and use that to notify the user.

System-level components injecting events into an arbitrarily-chosen user
session, or (slightly better) into each user session, is not how the
system/session split in D-Bus is intended to work. The intended way to
do this within D-Bus is to run some process in each user session, which
does something on the system bus (subscribes to broadcast notifications,
or explicitly requests unicast notifications if there's private data
involved) and produces popups or whatever.

There is currently no spec for a generic notification-receiving daemon
that does that on the system bus.

Consider whether every logged-in user should get these notifications
regardless of their level of privilege - broadcasts on the system bus
are not access-controlled, and anyone (or anything - system users too)
can see them.

Also consider what should happen if nobody is logged in...


desktop-devel-list mailing list
desktop-devel-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]