 |
pacemaker
2.0.1-9e909a5bdd
Scalable High-Availability cluster resource manager
|
Go to the documentation of this file.
8 #ifndef __PCMK_SERVICES__
9 # define __PCMK_SERVICES__
25 # include <sys/types.h>
28 # define OCF_ROOT_DIR "/usr/lib/ocf"
32 # define LSB_ROOT_DIR "/etc/init.d"
37 # define SYSTEMCTL "/bin/systemctl"
41 #define PCMK_RESOURCE_CLASS_OCF "ocf"
42 #define PCMK_RESOURCE_CLASS_SERVICE "service"
43 #define PCMK_RESOURCE_CLASS_LSB "lsb"
44 #define PCMK_RESOURCE_CLASS_SYSTEMD "systemd"
45 #define PCMK_RESOURCE_CLASS_UPSTART "upstart"
46 #define PCMK_RESOURCE_CLASS_NAGIOS "nagios"
47 #define PCMK_RESOURCE_CLASS_STONITH "stonith"
53 #define PCMK_OCF_REASON_PREFIX "ocf-exit-reason:"
56 #define PCMK_DEFAULT_AGENT_VERSION "0.1"
232 guint interval_ms,
int timeout );
253 const char *provider,
const char *agent,
254 const char *action, guint interval_ms,
255 int timeout , GHashTable *params,
303 int timeout, GHashTable *params,
304 int sequence,
void *cb_data);
308 static inline const char *services_lrm_status_str(
enum op_status status) {
318 default:
return "UNKNOWN!";
322 static inline const char *services_ocf_exitcode_str(
enum ocf_exitcode code) {
327 return "unknown error";
329 return "invalid parameter";
331 return "unimplemented feature";
333 return "insufficient privileges";
335 return "not installed";
337 return "not configured";
339 return "not running";
343 return "master (failed)";
347 return "OCF_NOT_SUPPORTED";
349 return "OCF_PENDING";
351 return "OCF_CANCELLED";
353 return "OCF_TIMEOUT";
355 return "OCF_OTHER_ERROR";
357 return "OCF_DEGRADED";
359 return "OCF_DEGRADED_MASTER";
374 services_get_ocf_exitcode(
const char *action,
int lsb_exitcode)
377 if (action && strcmp(action,
"status") && strcmp(action,
"monitor")) {
void services_action_free(svc_action_t *op)
@ PCMK_LSB_STATUS_INSUFFICIENT_PRIV
svc_action_t * services_action_create(const char *name, const char *action, guint interval_ms, int timeout)
svc_action_private_t * opaque
@ PCMK_OCF_DEGRADED_MASTER
enum svc_action_flags flags
@ PCMK_LSB_NOT_CONFIGURED
gboolean services_alert_async(svc_action_t *action, void(*cb)(svc_action_t *op))
Execute an alert agent action.
GList * resources_list_agents(const char *standard, const char *provider)
Get a list of resource agents.
@ PCMK_LSB_INSUFFICIENT_PRIV
int services_action_user(svc_action_t *op, const char *user)
Set the user and group that an action will execute as.
svc_action_t * services_alert_create(const char *id, const char *exec, int timeout, GHashTable *params, int sequence, void *cb_data)
Create an alert agent action.
svc_action_t * resources_action_create(const char *name, const char *standard, const char *provider, const char *agent, const char *action, guint interval_ms, int timeout, GHashTable *params, enum svc_action_flags flags)
Create a new resource action.
@ PCMK_OCF_CONNECTION_DIED
@ PCMK_LSB_STATUS_VAR_PID
@ PCMK_LSB_STATUS_UNKNOWN
@ PCMK_LSB_STATUS_VAR_LOCK
@ PCMK_LRM_OP_NOTSUPPORTED
struct svc_action_s svc_action_t
gboolean services_action_kick(const char *name, const char *action, guint interval_ms)
GList * services_list(void)
@ PCMK_LSB_STATUS_NOT_RUNNING
@ PCMK_OCF_INSUFFICIENT_PRIV
GList * resources_list_standards(void)
@ PCMK_LRM_OP_NOT_INSTALLED
gboolean services_action_sync(svc_action_t *op)
@ PCMK_LSB_UNIMPLEMENT_FEATURE
@ PCMK_LRM_OP_ERROR_FATAL
@ PCMK_OCF_UNIMPLEMENT_FEATURE
@ PCMK_LSB_STATUS_NOT_INSTALLED
const char * resources_find_service_class(const char *agent)
Find first service class that can provide a specified agent.
@ PCMK_OCF_NOT_CONFIGURED
GList * get_directory_list(const char *root, gboolean files, gboolean executable)
Get a list of files or directories in a given path.
svc_action_t * services_action_create_generic(const char *exec, const char *args[])
void services_action_cleanup(svc_action_t *op)
gboolean services_action_async(svc_action_t *op, void(*action_callback)(svc_action_t *))
@ PCMK_OCF_RUNNING_MASTER
@ NAGIOS_INSUFFICIENT_PRIV
gboolean services_action_cancel(const char *name, const char *action, guint interval_ms)
Cancel a recurring action.
GList * resources_list_providers(const char *standard)
Get a list of providers.