linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* communicating with user login sessions
@ 2003-04-08  4:37 Havoc Pennington
  2003-04-08  5:20 ` Greg KH
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Havoc Pennington @ 2003-04-08  4:37 UTC (permalink / raw)
  To: linux-hotplug

Hi,

There's this text on the hotplug web site, not sure it's up to date:

   A gap in current Linux support is that policies with any sort of
   dynamic "interact with user" component aren't currently
   supported. For example, that's often needed the first time a
   network adapter or printer is connected, and to determine
   appropriate places to mount disk drives. It would seem that such
   actions could be supported for any case where a responsible human
   can be identified: single user workstations, or any system which is
   remotely administered. This is a classic "remote sysadmin" problem,
   where in this case hotplugging needs to deliver an event from one
   security domain (operating system processes) to another (desktop
   for logged-in user, or remote sysadmin), and any effective response
   must go the other way. At this writing, Linux doesn't have widely
   adopted solutions to such problems.

This is by no means specific to device hotplugging - there's a general
problem of delivering events from the OS out to user login sessions.
Non-hotplug events might be things like "printer queue has changed"
(from the lpd daemon), or "I need a password now" (from the VPN
subsystem).

I'm working on some code with some other people that may provide a 
nice solution to this problem:
  http://www.freedesktop.org/software/dbus/

I don't know if people outside of the desktop world have heard of it
yet, or whether there are already similar solutions in progress for
hotplug specifically.

With D-BUS, the same code is used in three different use cases:

 - two applications communicate directly with each other
   by exchanging messages
 - applications send/receive broadcasts across a per-user 
   per-login-session message bus daemon
 - applications send/receive broadcasts across a systemwide
   per-machine message bus daemon

How it works:
 
 - there's a library which provides general "exchange messages between
   two applications" functionality; it handles authentication,
   creating a network transport, and serializing/unserializing
   messages to push them over the wire

 - on top of that general functionality, we've built a message bus 
   daemon

 - the message bus daemon can be customized via configuration file 
   to be systemwide or per-user-login-session. 
   (See http://www.freedesktop.org/software/dbus/doc/config-file.txt)

As an inside-login-session IPC mechanism, D-BUS gives us a way to link
different kinds of application (GNOME, KDE, plain old command line or
Xlib). This distinguishes it from tightly-bound-to-the-desktop APIs
such as Bonobo and DCOP, that require more buy-in to the GNOME/KDE
frameworks.

My understanding of how D-BUS would interact with hotplug is that the
hotplug scripts or daemon would briefly connect to the message bus,
inject a broadcast message, then disconnect again. This could be done
by linking to the D-BUS library, or by calling a simple command line
tool that linked to the D-BUS library. Or for efficiency, a daemon
could maintain a continuous connection to the message bus.

The mostly-but-not-completely-implemented plan is that there are
access controls built in to the message bus. So it's possible to
specify that only certain users or certain groups can send or receive
certain kinds of message.

The hope is that by making D-BUS useful in three different contexts,
portable to many operating systems, and X-style-licensed, it will be
widely used and will thus be robust and something that application
authors are comfortable relying on. We're also hoping to see GNOME and
KDE both adopt the system, which should help make it widely available.
If all desktop apps are linking to D-BUS anyhow, then it would be
really easy and simple for any app to monitor the systemwide message
bus and implement hardware-related features.

There is nothing X-specific about D-BUS, and it does not link to Xlib
(or indeed to much of anything - it's basically dependency-free with
the exception of "some XML parser to load the config file" - even the
XML parser dependency is on the daemon binary, not on the shared lib).

Some of the interesting features of D-BUS so far:
 - 63% of basic blocks covered by "make check" tests
 - dual licensed your choice of AFL (MIT/X license equivalent) or GPL
 - 100% API documentation, substantial internals documentation
 - partially complete protocol specification
 - significant amount of code implemented

Caveats:
 - the library is about 50% test code, unless you build with
   --disable-asserts --disable-verbose-mode --disable-tests
 - don't ship D-BUS in production yet, it has a number of 
   unimplemented yet essential security features (such
   as timing out unauthenticated connections)
 - some stuff is just broken
 - the API is still in flux

If this sounds interesting to the hotplug community, I'd hugely
appreciate it if people could read some of the D-BUS docs, hop on our
mailing list, play with the code, give feedback, or whatever interests
you. Right now most of the core desktop developers are on the D-BUS
mailing list, but we don't have a lot of representation from hackers
working on the system and hardware end of things.

There are a couple of TODO lists on the web page, and help on any of
that stuff would be welcome. Perhaps the most invaluable contribution
would be any amount of code auditing people have time for, whether
it's one file or a complete audit. Third party eyes are always a help.

If D-BUS proves useful for hardware events, I'd like to see a standard
set of events spec'd out, and used across all distributions. That way
projects such as GNOME and KDE can easily use those events without a
bunch of #ifdef SUSE #ifdef RED_HAT kind of stuff.

In any case, feedback is welcome. Specifics of D-BUS that aren't
directly related to its use with hotplug are probably best posted to
message-bus-list@freedesktop.org rather than this list, I don't want
to start an off-topic thread.

Thanks a lot,
Havoc



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-04-19  1:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-08  4:37 communicating with user login sessions Havoc Pennington
2003-04-08  5:20 ` Greg KH
2003-04-17 23:50 ` David Brownell
2003-04-18  0:13 ` David Brownell
2003-04-18  5:39 ` Havoc Pennington
2003-04-18  5:51 ` Havoc Pennington
2003-04-18 22:40 ` Greg KH
2003-04-18 23:45 ` David Brownell
2003-04-19  0:49 ` David Brownell
2003-04-19  1:24 ` Havoc Pennington
2003-04-19  1:30 ` Havoc Pennington
2003-04-19  1:43 ` Havoc Pennington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).