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

后端 未结 2 606
渐次进展
渐次进展 2021-01-02 12:29

I have a .service for a process that i don\'t want to start at boot-time, but to call it somehow from another already running application, at a given time.

The other

相关标签:
2条回答
  • 2021-01-02 12:55

    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);
    
    0 讨论(0)
  • 2021-01-02 13:12

    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.

    0 讨论(0)
提交回复
热议问题