[systemd-devel] calling systemctl from C++

Lennart Poettering lennart at poettering.net
Mon Nov 7 04:06:11 PST 2011


On Sun, 06.11.11 15:05, Michael D. Berger (m.d.berger at ieee.org) wrote:

> I see no way to directly call systemctl from a C++
> program, so I'll use a pipe.  Right?  I think a
> library function would be better.

If at all possible use the D-Bus interface when communicating with
systemd from your own programs. There's currently no documentation
available for that (for a reason: it's currently not covered by our
stable interface guarantee even though it's unlikely it will change
anymore) but it should be self-explanatory to some degree and is fully
introspectable on the bus with tools like d-feet or gdbus' client tool.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list