Several use-cases of dbus
Dmitry Morozhnikov
dmiceman at mail.ru
Thu Aug 25 12:27:06 PDT 2005
Hello all!
I`m plan to begin some hacking to make my desktop better as i see it (usually,
it is too difficult to describe what i wish to see than implement it by
self..) Generally, i`m not happy with current state of system-service/desktop
interoperability. And after some looking at this list i think what dbus is an
only right solution in that area.
But first of all, please correct my main assumption: per-login dbus daemon
connects to system dbus daemon and able to to and from it. (Unfortunately, i
was not found answer to this question after looking at documentation and
first-time looking at the code).
1.
Well, lets imagine first simple situation. Some service, say, hypothetical
virus scanner fired up by cron at some time. In my meaning desktop user
_should_ have been noticed about that. How it can be done.
Service on startup connects to system dbus and fire up broadcast notification.
In simple meaning, this service can`t and should no know who is logged in on
desktop, how much users logged in if any. So it can`t ask desktop dbus daemon
to start notification process. It just fire up notification about "Super
virus scanner is working". But who will listen for such messages?
I think there should be special per-login daemon which will serve such
notification. Name it.. DesktopAgent (and interface, therefore will be
something like org.freedesktop.dbus.desktopagent). After receiving
notification from service, it should:
1) Check if current user have some level of access to this specific service.
How? I don`t know.. Maybe check user/group of runned service and check user
permissions? Looks like transparent solution, but i`m not sure if this
possible with dbus at all.
2) If yes, select appropriate applet which is shipped with this specific
service and ask desktop dbus daemon to run it. Maybe service can provide
well-known name of such applet, so work of DesktopAgent will be pretty simple
in this case.
After that, in tray icon will appear some sign of runned service. User will be
able to control or ever stop it. But that part should be completely
applet-depended, i think.
Is it possible to implement DesktopAgent functionality into per-login dbus
daemon? Yes, but i`m very unsure what this is good idea.
2.
Okay. Let`s imagine more complicated example. Super virus scanner was started
at 10:00 am as expected, but.. user, after two cups of coffee, reach computer
at 10:05 am. How it will know about runned service if DesktopAgent have no
chance to receive notification from it?
In my opinion, DesktopAgent just after startup should fire up broadcast
message, something like "Please renotify me" which will cause all services
interested in it resend notifications "I`m there". Probably, such operation
should be repeated each five minutes or so, to avoid message lost, etc..
3.
Continuing with virus scanner. Today, it is possible to intercept file system
access to some infected file and do some action on it (dazuko project for
example). But user have no chance to interact with anti-virus software to
tell it which action should be performed. Okay, having DesktopAgent and
antivirus which can interact with it, it is possible to run special applet to
ask user a question (delete, quarantine, heal, ignore, etc..). But.. What if
there are no one near the computer? How long service should wait to perform
default action? And most important question in our context: should it be
notified if question dialog is appear to the user at all?
4.
Last scenario i can remember now :-)
Some dialup service is issued to run by kmail for example. Unfortunately,
modem is busy for a moment by ifmail (there are few peoples who know what is
that, but it is not meaningful :-). Kmail uses dbus to perform this action
and receive negative response immediately. But other peoples logged it also
want to know about this error! And yes, it is pretty possible to create
another special applet, specific to this dialup service which will display
error and exit. But may be it is more simple to allow DesktopAgent to respond
by self for some specific action like system error messages? Any ideas?
P.S. Please forgive me if my questions are completely stupid or there is
already some projects with such purpose. Unfortunately, i can`t start work
right now, but i want to have some food for the thought now. I`m not sure if
this is possible at all with dbus or if this feet dbus design/purpose at all.
P.P.S. Please, if this possible don`t tell me "noone need such antivirus under
linux". This is not an answer. After last fight with Gaelitum.A under windows
i`m a little paranoid about that. Anyway, it is used only for example.
P.P.P.S. And.. Please forgive my pure English :-)
--
Dmitry Morozhnikov
mailto:dmiceman at mail.ru
More information about the dbus
mailing list