pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
Macros | Functions
systemd.c File Reference
#include <crm_internal.h>
#include <crm/crm.h>
#include <crm/common/xml.h>
#include <crm/services.h>
#include <crm/services_internal.h>
#include <crm/common/mainloop.h>
#include <sys/stat.h>
#include <gio/gio.h>
#include <services_private.h>
#include <systemd.h>
#include <dbus/dbus.h>
#include <pcmk-dbus.h>
Include dependency graph for systemd.c:

Go to the source code of this file.

Macros

#define BUS_NAME   "org.freedesktop.systemd1"
 
#define BUS_NAME_MANAGER   BUS_NAME ".Manager"
 
#define BUS_NAME_UNIT   BUS_NAME ".Unit"
 
#define BUS_PATH   "/org/freedesktop/systemd1"
 
#define METADATA_FORMAT
 
#define SYSTEMD_OVERRIDE_ROOT   "/run/systemd/system/"
 
#define SYSTEMD_OVERRIDE_TEMPLATE
 

Functions

int services__systemd_prepare (svc_action_t *op)
 
enum ocf_exitcode services__systemd2ocf (int exit_status)
 
void systemd_cleanup (void)
 
GList * systemd_unit_listall (void)
 
gboolean systemd_unit_exists (const char *name)
 
int services__execute_systemd (svc_action_t *op)
 

Macro Definition Documentation

◆ BUS_NAME

#define BUS_NAME   "org.freedesktop.systemd1"

Definition at line 26 of file systemd.c.

◆ BUS_NAME_MANAGER

#define BUS_NAME_MANAGER   BUS_NAME ".Manager"

Definition at line 27 of file systemd.c.

◆ BUS_NAME_UNIT

#define BUS_NAME_UNIT   BUS_NAME ".Unit"

Definition at line 28 of file systemd.c.

◆ BUS_PATH

#define BUS_PATH   "/org/freedesktop/systemd1"

Definition at line 29 of file systemd.c.

◆ METADATA_FORMAT

#define METADATA_FORMAT
Value:
"<?xml " PCMK_XA_VERSION "=\"1.0\"?>\n" \
PCMK_XA_NAME "=\"%s\" " \
PCMK_XA_VERSION "=\"" PCMK_DEFAULT_AGENT_VERSION "\">\n" \
" <" PCMK_XE_VERSION ">1.1</" PCMK_XE_VERSION ">\n" \
" <" PCMK_XE_LONGDESC " " PCMK_XA_LANG "=\"" PCMK__VALUE_EN "\">\n" \
" %s\n" \
" </" PCMK_XE_LONGDESC ">\n" \
"systemd unit file for %s" \
"</" PCMK_XE_SHORTDESC ">\n" \
" <" PCMK_XE_PARAMETERS "/>\n" \
" <" PCMK_XE_ACTIONS ">\n" \
" " PCMK_META_TIMEOUT "=\"100s\" />\n" \
" " PCMK_META_TIMEOUT "=\"100s\" />\n" \
" " PCMK_META_TIMEOUT "=\"100s\" />\n" \
" " PCMK_META_TIMEOUT "=\"100s\"" \
" " PCMK_META_INTERVAL "=\"60s\" />\n" \
" " PCMK_META_TIMEOUT "=\"5s\" />\n" \
" </" PCMK_XE_ACTIONS ">\n" \
" <" PCMK_XE_SPECIAL " " PCMK_XA_TAG "=\"systemd\"/>\n" \
#define PCMK_XA_NAME
Definition: xml_names.h:325
#define PCMK_XA_TAG
Definition: xml_names.h:412
#define PCMK_ACTION_META_DATA
Definition: actions.h:56
#define PCMK_ACTION_MONITOR
Definition: actions.h:60
#define PCMK_XE_PARAMETERS
Definition: xml_names.h:156
#define PCMK_XE_LONGDESC
Definition: xml_names.h:126
#define PCMK_ACTION_STATUS
Definition: actions.h:73
#define PCMK_XE_VERSION
Definition: xml_names.h:215
#define PCMK__VALUE_EN
#define PCMK_ACTION_START
Definition: actions.h:72
#define PCMK_ACTION_STOP
Definition: actions.h:75
#define PCMK_META_TIMEOUT
Definition: options.h:114
#define PCMK_XE_SHORTDESC
Definition: xml_names.h:195
#define PCMK_XE_RESOURCE_AGENT
Definition: xml_names.h:169
#define PCMK_META_INTERVAL
Definition: options.h:91
#define PCMK_XE_ACTION
Definition: xml_names.h:60
#define PCMK_XE_ACTIONS
Definition: xml_names.h:61
#define PCMK_DEFAULT_AGENT_VERSION
Definition: services.h:49
#define PCMK_XA_LANG
Definition: xml_names.h:308
#define PCMK_XE_SPECIAL
Definition: xml_names.h:197
#define PCMK_XA_VERSION
Definition: xml_names.h:439

Definition at line 668 of file systemd.c.

◆ SYSTEMD_OVERRIDE_ROOT

#define SYSTEMD_OVERRIDE_ROOT   "/run/systemd/system/"

Definition at line 800 of file systemd.c.

◆ SYSTEMD_OVERRIDE_TEMPLATE

#define SYSTEMD_OVERRIDE_TEMPLATE
Value:
"[Unit]\n" \
"Description=Cluster Controlled %s\n" \
"Before=pacemaker.service pacemaker_remote.service\n" \
"\n" \
"[Service]\n" \
"Restart=no\n"

Definition at line 811 of file systemd.c.

Function Documentation

◆ services__execute_systemd()

int services__execute_systemd ( svc_action_t op)

Definition at line 1080 of file systemd.c.

◆ services__systemd2ocf()

enum ocf_exitcode services__systemd2ocf ( int  exit_status)

Definition at line 58 of file systemd.c.

◆ services__systemd_prepare()

int services__systemd_prepare ( svc_action_t op)

Definition at line 40 of file systemd.c.

◆ systemd_cleanup()

void systemd_cleanup ( void  )

Definition at line 172 of file systemd.c.

◆ systemd_unit_exists()

gboolean systemd_unit_exists ( const char *  name)

Definition at line 639 of file systemd.c.

◆ systemd_unit_listall()

GList* systemd_unit_listall ( void  )

Definition at line 542 of file systemd.c.