How to manage Linux services



  • On Windows there are many apis to manage the services such as
    EnumServicesStatusEx
    I need to manage (start, stop, isStarted, isStopped) two services, related to my application.
    Is there a nice approach, without to use QProcess and console commands?


  • Qt Champions 2017

    Hi @mrdebug,

    that depends which init system your target Linux uses.

    For example systemd (which is used in modern systems like Ubuntu 16.04), provides a D-Bus API

    Remember that you need elevated privileges to start/stop services from the command line, I expect the same applies to the API also.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.