RADLib
RADical C++ application framework
RADService::ServiceManager Class Reference

Service helper methods. More...

#include <RADService.h>

Static Public Member Functions

static std::string generateSystemdUnit (const ServiceUnit &unit)
 Serializes a systemd unit file. More...
 
static bool writeSystemdUnit (const ServiceUnit &unit, const std::string &directory, std::string *error=nullptr)
 Writes a systemd unit file to directory. More...
 
static bool notify (const std::string &message, std::string *error=nullptr)
 Sends sd_notify-compatible message to NOTIFY_SOCKET without libsystemd. More...
 
static bool notifyReady (std::string *error=nullptr)
 Sends READY=1 notification. More...
 
static bool notifyWatchdog (std::string *error=nullptr)
 Sends WATCHDOG=1 notification. More...
 
static std::string restartPolicyName (RestartPolicy policy)
 Converts restart policy to systemd text. More...
 
static bool daemonize (std::string *error=nullptr)
 Performs a Unix double-fork daemonization when supported. More...
 

Detailed Description

Service helper methods.

Member Function Documentation

◆ daemonize()

static bool RADService::ServiceManager::daemonize ( std::string *  error = nullptr)
static

Performs a Unix double-fork daemonization when supported.

◆ generateSystemdUnit()

static std::string RADService::ServiceManager::generateSystemdUnit ( const ServiceUnit unit)
static

Serializes a systemd unit file.

◆ notify()

static bool RADService::ServiceManager::notify ( const std::string &  message,
std::string *  error = nullptr 
)
static

Sends sd_notify-compatible message to NOTIFY_SOCKET without libsystemd.

◆ notifyReady()

static bool RADService::ServiceManager::notifyReady ( std::string *  error = nullptr)
static

Sends READY=1 notification.

◆ notifyWatchdog()

static bool RADService::ServiceManager::notifyWatchdog ( std::string *  error = nullptr)
static

Sends WATCHDOG=1 notification.

◆ restartPolicyName()

static std::string RADService::ServiceManager::restartPolicyName ( RestartPolicy  policy)
static

Converts restart policy to systemd text.

◆ writeSystemdUnit()

static bool RADService::ServiceManager::writeSystemdUnit ( const ServiceUnit unit,
const std::string &  directory,
std::string *  error = nullptr 
)
static

Writes a systemd unit file to directory.


The documentation for this class was generated from the following file: