class ServiceManager {
public:
ServiceManager() = delete;
- ServiceManager(const std::string &serviceName);
+ ServiceManager(const std::string &serviceName,
+ const std::vector<std::string>& socketsNames = {});
~ServiceManager() = default;
- void startService();
- void stopService();
- void restartService();
+ void startService(bool withSockets = false);
+ void stopService(bool withSockets = false);
+ void restartService(bool withSockets = false);
pid_t getServicePid();
timeval getServiceStartTimestamp();
void maskService();
uint32_t handleVariantUIntMsgReply(DBus::MessageIn &messageIn);
uint64_t handleVariantUInt64MsgReply(DBus::MessageIn &messageIn);
- void sendToService(const std::string &method);
+ void sendToService(const std::string &method, const std::string &unit);
void sendMaskToService();
void sendUnmaskToService();
DBus::MessageIn sendPropertyGetMsg(const std::string &interface, const std::string &property);
void signalReloadingHandler(DBus::MessageIn &messageIn);
void waitForRunningJobsFinish();
+ void executeMethod(const std::string &method, const std::string &unit);
+
DBus::Connection m_connection;
const std::string m_serviceName;
+ const std::vector<std::string> m_socketsNames;
std::string m_unitPath;
std::set<std::string> m_runningJobs;