#include <crm_internal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <pwd.h>
#include <time.h>
#include <libgen.h>
#include <signal.h>
#include <qb/qbdefs.h>
#include <crm/crm.h>
#include <crm/services.h>
#include <crm/msg_xml.h>
#include <crm/cib/internal.h>
#include <crm/common/xml.h>
#include <crm/common/util.h>
#include <crm/common/ipc.h>
#include <crm/common/iso8601.h>
#include <crm/common/mainloop.h>
#include <libxml2/libxml/relaxng.h>
#include "crmcommon_private.h"
Go to the source code of this file.
|
| CRM_TRACE_INIT_DATA (common) |
|
int | char2score (const char *score) |
|
char * | score2char_stack (int score, char *buf, size_t len) |
|
char * | score2char (int score) |
|
int | crm_user_lookup (const char *name, uid_t *uid, gid_t *gid) |
|
int | pcmk_daemon_user (uid_t *uid, gid_t *gid) |
| Get user and group IDs of pacemaker daemon user. More...
|
|
int | compare_version (const char *version1, const char *version2) |
|
guint | crm_parse_interval_spec (const char *input) |
| Parse milliseconds from a Pacemaker interval specification. More...
|
|
void | crm_abort (const char *file, const char *function, int line, const char *assert_condition, gboolean do_core, gboolean do_fork) |
|
void | pcmk__daemonize (const char *name, const char *pidfile) |
|
char * | crm_meta_name (const char *field) |
|
const char * | crm_meta_value (GHashTable *hash, const char *field) |
|
char * | crm_generate_uuid (void) |
|
char * | pcmk_hostname () |
| Get the local hostname. More...
|
|
bool | pcmk_str_is_infinity (const char *s) |
|
bool | pcmk_str_is_minus_infinity (const char *s) |
|
void | pcmk__sleep_ms (unsigned int ms) |
|
#define PW_BUFFER_LEN 500 |
int char2score |
( |
const char * |
score | ) |
|
int compare_version |
( |
const char * |
version1, |
|
|
const char * |
version2 |
|
) |
| |
void crm_abort |
( |
const char * |
file, |
|
|
const char * |
function, |
|
|
int |
line, |
|
|
const char * |
assert_condition, |
|
|
gboolean |
do_core, |
|
|
gboolean |
do_fork |
|
) |
| |
char* crm_generate_uuid |
( |
void |
| ) |
|
char* crm_meta_name |
( |
const char * |
field | ) |
|
const char* crm_meta_value |
( |
GHashTable * |
hash, |
|
|
const char * |
field |
|
) |
| |
guint crm_parse_interval_spec |
( |
const char * |
input | ) |
|
Parse milliseconds from a Pacemaker interval specification.
- Parameters
-
[in] | input | Pacemaker time interval specification (a bare number of seconds, a number with a unit optionally with whitespace before and/or after the number, or an ISO 8601 duration) |
- Returns
- Milliseconds equivalent of given specification on success (limited to the range of an unsigned integer), 0 if input is NULL, or 0 (and set errno to EINVAL) on error
Definition at line 314 of file utils.c.
CRM_TRACE_INIT_DATA |
( |
common |
| ) |
|
int crm_user_lookup |
( |
const char * |
name, |
|
|
uid_t * |
uid, |
|
|
gid_t * |
gid |
|
) |
| |
void pcmk__daemonize |
( |
const char * |
name, |
|
|
const char * |
pidfile |
|
) |
| |
void pcmk__sleep_ms |
( |
unsigned int |
ms | ) |
|
int pcmk_daemon_user |
( |
uid_t * |
uid, |
|
|
gid_t * |
gid |
|
) |
| |
Get user and group IDs of pacemaker daemon user.
- Parameters
-
[out] | uid | If non-NULL, where to store daemon user ID |
[out] | gid | If non-NULL, where to store daemon group ID |
- Returns
- pcmk_ok on success, -errno otherwise
Definition at line 169 of file utils.c.
char* pcmk_hostname |
( |
void |
| ) |
|
Get the local hostname.
- Returns
- Newly allocated string with name, or NULL (and set errno) on error
Definition at line 577 of file utils.c.
bool pcmk_str_is_infinity |
( |
const char * |
s | ) |
|
bool pcmk_str_is_minus_infinity |
( |
const char * |
s | ) |
|
char* score2char |
( |
int |
score | ) |
|
char* score2char_stack |
( |
int |
score, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
gboolean crm_config_error = FALSE |
- Deprecated:
- Pacemaker library functions set this when a configuration error is found, which turns on extra messages at the end of processing. It should not be used directly and will be removed from the public C API in a future release.
Definition at line 52 of file utils.c.
gboolean crm_config_warning = FALSE |
- Deprecated:
- Pacemaker library functions set this when a configuration warning is found, which turns on extra messages at the end of processing. It should not be used directly and will be removed from the public C API in a future release.
Definition at line 53 of file utils.c.
char* crm_system_name = NULL |
int pcmk__score_green = 0 |
int pcmk__score_yellow = 0 |