[systemd-devel] calling systemctl from C++

Christian Parpart trapni at gentoo.org
Mon Nov 7 01:24:14 PST 2011


use popen() to invoke external programs, or for more control,
execve()/execvp()/etc. :)

otherwise, using systemd-provided API (like its DBus-API is always
preferable)

Regards,
Christian Parpart.


On Sun, Nov 6, 2011 at 9:43 PM, Michael Biebl <mbiebl at gmail.com> wrote:

> 2011/11/6 Michael D. Berger <m.d.berger at ieee.org>:
> > 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.
>
> Not knowing exactly what you are trying to do, please note you can use
> D-Bus to access systemd.
> If you are using C++, using QtDBus is probably the most convenient way.
>
> Michael
>
> --
> Why is it that all of the instruments seeking intelligent life in the
> universe are pointed away from Earth?
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20111107/c76d3134/attachment.html>


More information about the systemd-devel mailing list