[systemd-devel] [RFC] activate on DBus signal
camerontnorman at gmail.com
Mon Mar 23 22:53:08 PDT 2015
On Mon, Mar 23, 2015 at 1:54 AM, WaLyong Cho <walyong.cho at samsung.com> wrote:
> Now, I'm looking for a method to a service be activated on special DBus
> signal. If a process is running for waiting some of DBus signal this can
> be useful.
Obviously you want to use systemd, but you may want look at prior art
in Upstart with the upstart-dbus-bridge:
> I already told with Simon in DBus mailing list.
> see this thread:
> Simon said:
> "If it did, there are some nasty ordering constraints - I certainly
> wouldn't want to have to delay delivery of a broadcast until all
> interested services had started up! - so I don't think adding this
> feature would be a good idea."
> How about also support for DBus signal?
> My idea is...
> Add new configuration directory. (e.g. "/etc/systemd/active-by-signal")
> And service can install its configuration file on there with below
> format. (Please don't care of its detail. It just a example.)
I would think this fits better as a new unit type. These units would
act just like socket, path, or timer units, in that they launch
services (default of service of the same name) when an event occurs.
Regardless of implementation, this is definitely a useful feature that
I can see being used in a few situations already. For example, in
elementary OS we use a NM dispatcher script to detect captive logins
and autoprompt users, but this requires hacky setting of DISPLAY
variables in that script. It would be cleaner if we could just launch
a script when NM signals the connection coming. This would be a
user/session service so there would be no need to manually set env
variables like DISPLAY.
Here is the script for reference:
More information about the systemd-devel