Start systemd service from C/C++ application or call a D-Bus service

大城市里の小女人 提交于 2019-11-30 14:06:01

A combination of g_dbus_connection_send_message with g_dbus_message_new_method_call or g_dbus_message_new_signal should be what you are looking for.

I had trouble to do the same thing. The discover of : G_BUS_NAME_WATCHER_FLAGS_AUTO_START solve it.

g_bus_watch_name(G_BUS_TYPE_SYSTEM, "com.mydbus.listen",
      G_BUS_NAME_WATCHER_FLAGS_AUTO_START, xOnNameAppeared, xOnNameVanished,
      this, nullptr);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!