pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
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 <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.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_UNIT_OVERRIDE_TEMPLATE
 
#define SYSTEMD_SERVICE_OVERRIDE
 

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)
 
bool 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 33 of file systemd.c.

◆ BUS_NAME_MANAGER

#define BUS_NAME_MANAGER   BUS_NAME ".Manager"

Definition at line 34 of file systemd.c.

◆ BUS_NAME_UNIT

#define BUS_NAME_UNIT   BUS_NAME ".Unit"

Definition at line 35 of file systemd.c.

◆ BUS_PATH

#define BUS_PATH   "/org/freedesktop/systemd1"

Definition at line 36 of file systemd.c.

◆ METADATA_FORMAT

#define METADATA_FORMAT
Value:
"<?xml " PCMK_XA_VERSION "=\"1.0\"?>\n" \
PCMK_XA_NAME "=\"%s\" " \
" <" 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_ACTION_STATUS
Definition actions.h:64
#define PCMK_ACTION_STOP
Definition actions.h:66
#define PCMK_ACTION_META_DATA
Definition actions.h:47
#define PCMK_ACTION_START
Definition actions.h:63
#define PCMK_ACTION_MONITOR
Definition actions.h:51
#define PCMK_META_INTERVAL
Definition options.h:92
#define PCMK_META_TIMEOUT
Definition options.h:115
#define PCMK__VALUE_EN
#define PCMK_DEFAULT_AGENT_VERSION
Definition services.h:49
#define PCMK_XE_ACTIONS
Definition xml_names.h:61
#define PCMK_XE_SHORTDESC
Definition xml_names.h:199
#define PCMK_XE_VERSION
Definition xml_names.h:220
#define PCMK_XE_SPECIAL
Definition xml_names.h:201
#define PCMK_XA_LANG
Definition xml_names.h:313
#define PCMK_XA_VERSION
Definition xml_names.h:444
#define PCMK_XE_PARAMETERS
Definition xml_names.h:159
#define PCMK_XE_ACTION
Definition xml_names.h:60
#define PCMK_XE_RESOURCE_AGENT
Definition xml_names.h:173
#define PCMK_XA_TAG
Definition xml_names.h:417
#define PCMK_XA_NAME
Definition xml_names.h:330
#define PCMK_XE_LONGDESC
Definition xml_names.h:129

Definition at line 738 of file systemd.c.

◆ SYSTEMD_SERVICE_OVERRIDE

#define SYSTEMD_SERVICE_OVERRIDE
Value:
"\n" \
"[Service]\n" \
"Restart=no\n"

Definition at line 1029 of file systemd.c.

◆ SYSTEMD_UNIT_OVERRIDE_TEMPLATE

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

Definition at line 1024 of file systemd.c.

Function Documentation

◆ services__execute_systemd()

int services__execute_systemd ( svc_action_t * op)

Definition at line 1386 of file systemd.c.

◆ services__systemd2ocf()

enum ocf_exitcode services__systemd2ocf ( int exit_status)

Definition at line 65 of file systemd.c.

◆ services__systemd_prepare()

int services__systemd_prepare ( svc_action_t * op)

Definition at line 47 of file systemd.c.

◆ systemd_cleanup()

void systemd_cleanup ( void )

Definition at line 228 of file systemd.c.

◆ systemd_unit_exists()

bool systemd_unit_exists ( const char * name)

Definition at line 709 of file systemd.c.

◆ systemd_unit_listall()

GList * systemd_unit_listall ( void )

Definition at line 612 of file systemd.c.