System to user activation

Kimmo.Hamalainen at nokia.com Kimmo.Hamalainen at nokia.com
Fri Jul 8 20:15:02 EST 2005



> -----Original Message-----
> From: dbus-bounces at lists.freedesktop.org
> [mailto:dbus-bounces at lists.freedesktop.org]On Behalf Of ext Ruben
> Vermeersch
> Sent: 07 July, 2005 17:50
> To: dbus at lists.freedesktop.org
> Subject: System to user activation
> 
> 
> Hi guys, 
> 
> I'm trying to do a system daemon to user client activation:
> 
> I have written a program called tempd, which monitors the 
> temperature of
> my laptop (Dell laptops include monitoring through a special module).
> This daemon always runs, periodically checks the temperature 
> and adjusts
> the fans if necessary.
> 
> Now I want to add the following: If the temperature goes up too high,
> the daemon fully throttles up the fans, I'd then like it to send out a
> DBus signal, so that a program for the running desktop user gets
> started, showing a notification icon, informing the user about the
> temperature.
> 
> Is this possible through DBus activation, the tempd daemon will run as
> root (or a special user), the notification program should be activated
> as the logged in desktop user (in order to access the systray 
> etc). Can
> this be done? Are there documents about this?

At least in 0.23 it can be done. You need to install a ".service" file
for the session bus daemon so that it knows how to start the UI program
and to assign a D-BUS service name for the UI program. Then, the root
process needs to know the session bus' address and send a message having
the auto-activation flag to the UI program's service. The message should
make the session bus daemon to start the UI program. The program is started
as the same user as the daemon is running and it will inherit the environment
from the daemon as well. In some 0.23.x version the root user wasn't allowed
to connect to the session but, but you can allow it by modifying the
daemon's configuration file.

BR, Kimmo
 
> I've been looking around for some documents, but given the 
> in-motionness
> (AFAICT) of DBus, there aren't much. Though I'm not a good 
> writer, I've
> been thinking of bundling everything in some kind of all-purpose guide
> to DBus, once I grab hold of good DBus practices.
> 
>         Regards,
>                 Ruben
> 
> 
> --
> Ruben Vermeersch (rubenv)
> http://www.Lambda1.be/
> 
> -- 
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
> 


More information about the dbus mailing list