pacemaker
2.1.4-dc6eb4362
Scalable High-Availability cluster resource manager
|
#include <unistd.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <glib.h>
#include <libxml/tree.h>
#include <crm/common/util.h>
#include <crm/common/logging.h>
#include <crm/common/mainloop.h>
#include <crm/common/health_internal.h>
#include <crm/common/iso8601_internal.h>
#include <crm/common/results_internal.h>
#include <crm/common/messages_internal.h>
#include <crm/common/strings_internal.h>
Go to the source code of this file.
Macros | |
#define | PCMK__NELEM(a) ((int) (sizeof(a)/sizeof(a[0])) ) |
#define | PCMK__OP_FMT "%s_%s_%u" |
#define | PCMK__FAIL_COUNT_PREFIX "fail-count" |
#define | PCMK__LAST_FAILURE_PREFIX "last-failure" |
Functions | |
char * | pcmk__uid2username (uid_t uid) |
const char * | pcmk__update_acl_user (xmlNode *request, const char *field, const char *peer_user) |
void | pcmk__enable_acl (xmlNode *acl_source, xmlNode *target, const char *user) |
bool | pcmk__check_acl (xmlNode *xml, const char *name, enum xml_private_flags mode) |
bool | pcmk__verify_digest (xmlNode *input, const char *expected) |
int | pcmk__real_path (const char *path, char **resolved_path) |
char * | pcmk__series_filename (const char *directory, const char *series, int sequence, bool bzip) |
int | pcmk__read_series_sequence (const char *directory, const char *series, unsigned int *seq) |
void | pcmk__write_series_sequence (const char *directory, const char *series, unsigned int sequence, int max) |
int | pcmk__chown_series_sequence (const char *directory, const char *series, uid_t uid, gid_t gid) |
int | pcmk__build_path (const char *path_c, mode_t mode) |
char * | pcmk__full_path (const char *filename, const char *dirname) |
Duplicate a file path, inserting a prefix if not absolute. More... | |
bool | pcmk__daemon_can_write (const char *dir, const char *file) |
void | pcmk__sync_directory (const char *name) |
int | pcmk__file_contents (const char *filename, char **contents) |
int | pcmk__write_sync (int fd, const char *contents) |
int | pcmk__set_nonblocking (int fd) |
const char * | pcmk__get_tmpdir (void) |
void | pcmk__close_fds_in_child (bool) |
int | pcmk__add_mainloop_ipc (crm_ipc_t *ipc, int priority, void *userdata, struct ipc_client_callbacks *callbacks, mainloop_io_t **source) |
Connect to IPC and add it as a main loop source. More... | |
guint | pcmk__mainloop_timer_get_period (mainloop_timer_t *timer) |
Get period for mainloop timer. More... | |
int | pcmk__scan_nvpair (const char *input, char **name, char **value) |
char * | pcmk__format_nvpair (const char *name, const char *value, const char *units) |
char * | pcmk__format_named_time (const char *name, time_t epoch_time) |
void | pcmk__xe_set_bool_attr (xmlNodePtr node, const char *name, bool value) |
bool | pcmk__xe_attr_is_true (xmlNodePtr node, const char *name) |
int | pcmk__xe_get_bool_attr (xmlNodePtr node, const char *name, bool *value) |
pid_t | pcmk__procfs_pid_of (const char *name) |
unsigned int | pcmk__procfs_num_cores (void) |
void | crm_schema_init (void) |
void | crm_schema_cleanup (void) |
int | pcmk__pid_active (pid_t pid, const char *daemon) |
int | pcmk__read_pidfile (const char *filename, pid_t *pid) |
int | pcmk__pidfile_matches (const char *filename, pid_t expected_pid, const char *expected_name, pid_t *pid) |
int | pcmk__lock_pidfile (const char *filename, const char *name) |
char * | pcmk__op_key (const char *rsc_id, const char *op_type, guint interval_ms) |
Generate an operation key (RESOURCE_ACTION_INTERVAL) More... | |
char * | pcmk__notify_key (const char *rsc_id, const char *notify_type, const char *op_type) |
char * | pcmk__transition_key (int transition_id, int action_id, int target_rc, const char *node) |
void | pcmk__filter_op_for_digest (xmlNode *param_set) |
bool | pcmk__is_fencing_action (const char *action) |
void | pcmk__daemonize (const char *name, const char *pidfile) |
void | pcmk__panic (const char *origin) |
pid_t | pcmk__locate_sbd (void) |
void | pcmk__sleep_ms (unsigned int ms) |
int | pcmk__effective_rc (int rc) |
Variables | |
bool | pcmk__is_daemon |
int | pcmk__score_red |
int | pcmk__score_green |
int | pcmk__score_yellow |
#define PCMK__FAIL_COUNT_PREFIX "fail-count" |
Definition at line 358 of file internal.h.
#define PCMK__LAST_FAILURE_PREFIX "last-failure" |
Definition at line 359 of file internal.h.
#define PCMK__NELEM | ( | a | ) | ((int) (sizeof(a)/sizeof(a[0])) ) |
Definition at line 42 of file internal.h.
#define PCMK__OP_FMT "%s_%s_%u" |
Definition at line 215 of file internal.h.
int pcmk__add_mainloop_ipc | ( | crm_ipc_t * | ipc, |
int | priority, | ||
void * | userdata, | ||
struct ipc_client_callbacks * | callbacks, | ||
mainloop_io_t ** | source | ||
) |
Connect to IPC and add it as a main loop source.
[in] | ipc | IPC connection to add |
[in] | priority | Event source priority to use for connection |
[in] | userdata | Data to register with callbacks |
[in] | callbacks | Dispatch and destroy callbacks for connection |
[out] | source | Newly allocated event source |
Definition at line 894 of file mainloop.c.
bool pcmk__check_acl | ( | xmlNode * | xml, |
const char * | name, | ||
enum xml_private_flags | mode | ||
) |
int pcmk__chown_series_sequence | ( | const char * | directory, |
const char * | series, | ||
uid_t | uid, | ||
gid_t | gid | ||
) |
bool pcmk__daemon_can_write | ( | const char * | dir, |
const char * | file | ||
) |
void pcmk__daemonize | ( | const char * | name, |
const char * | pidfile | ||
) |
void pcmk__enable_acl | ( | xmlNode * | acl_source, |
xmlNode * | target, | ||
const char * | user | ||
) |
int pcmk__file_contents | ( | const char * | filename, |
char ** | contents | ||
) |
void pcmk__filter_op_for_digest | ( | xmlNode * | param_set | ) |
Definition at line 390 of file operations.c.
char* pcmk__format_named_time | ( | const char * | name, |
time_t | epoch_time | ||
) |
char* pcmk__format_nvpair | ( | const char * | name, |
const char * | value, | ||
const char * | units | ||
) |
char* pcmk__full_path | ( | const char * | filename, |
const char * | dirname | ||
) |
bool pcmk__is_fencing_action | ( | const char * | action | ) |
Definition at line 536 of file operations.c.
pid_t pcmk__locate_sbd | ( | void | ) |
Definition at line 199 of file watchdog.c.
int pcmk__lock_pidfile | ( | const char * | filename, |
const char * | name | ||
) |
guint pcmk__mainloop_timer_get_period | ( | mainloop_timer_t * | timer | ) |
Get period for mainloop timer.
[in] | timer | Timer |
Definition at line 927 of file mainloop.c.
char* pcmk__notify_key | ( | const char * | rsc_id, |
const char * | notify_type, | ||
const char * | op_type | ||
) |
Definition at line 229 of file operations.c.
char* pcmk__op_key | ( | const char * | rsc_id, |
const char * | op_type, | ||
guint | interval_ms | ||
) |
Generate an operation key (RESOURCE_ACTION_INTERVAL)
[in] | rsc_id | ID of resource being operated on |
[in] | op_type | Operation name |
[in] | interval_ms | Operation interval |
Definition at line 45 of file operations.c.
void pcmk__panic | ( | const char * | origin | ) |
Definition at line 162 of file watchdog.c.
int pcmk__pidfile_matches | ( | const char * | filename, |
pid_t | expected_pid, | ||
const char * | expected_name, | ||
pid_t * | pid | ||
) |
int pcmk__read_series_sequence | ( | const char * | directory, |
const char * | series, | ||
unsigned int * | seq | ||
) |
int pcmk__real_path | ( | const char * | path, |
char ** | resolved_path | ||
) |
int pcmk__scan_nvpair | ( | const char * | input, |
char ** | name, | ||
char ** | value | ||
) |
char* pcmk__series_filename | ( | const char * | directory, |
const char * | series, | ||
int | sequence, | ||
bool | bzip | ||
) |
char* pcmk__transition_key | ( | int | transition_id, |
int | action_id, | ||
int | target_rc, | ||
const char * | node | ||
) |
Definition at line 296 of file operations.c.
const char* pcmk__update_acl_user | ( | xmlNode * | request, |
const char * | field, | ||
const char * | peer_user | ||
) |
bool pcmk__verify_digest | ( | xmlNode * | input, |
const char * | expected | ||
) |
void pcmk__write_series_sequence | ( | const char * | directory, |
const char * | series, | ||
unsigned int | sequence, | ||
int | max | ||
) |
bool pcmk__xe_attr_is_true | ( | xmlNodePtr | node, |
const char * | name | ||
) |
int pcmk__xe_get_bool_attr | ( | xmlNodePtr | node, |
const char * | name, | ||
bool * | value | ||
) |
void pcmk__xe_set_bool_attr | ( | xmlNodePtr | node, |
const char * | name, | ||
bool | value | ||
) |