 |
pacemaker
2.0.4-2deceaa3ae
Scalable High-Availability cluster resource manager
|
Go to the documentation of this file.
10 #ifndef __PCMK_SERVICES__
11 # define __PCMK_SERVICES__
27 # include <sys/types.h>
30 # define OCF_ROOT_DIR "/usr/lib/ocf"
34 # define LSB_ROOT_DIR "/etc/init.d"
39 # define SYSTEMCTL "/bin/systemctl"
43 #define PCMK_RESOURCE_CLASS_OCF "ocf"
44 #define PCMK_RESOURCE_CLASS_SERVICE "service"
45 #define PCMK_RESOURCE_CLASS_LSB "lsb"
46 #define PCMK_RESOURCE_CLASS_SYSTEMD "systemd"
47 #define PCMK_RESOURCE_CLASS_UPSTART "upstart"
48 #define PCMK_RESOURCE_CLASS_NAGIOS "nagios"
49 #define PCMK_RESOURCE_CLASS_STONITH "stonith"
55 #define PCMK_OCF_REASON_PREFIX "ocf-exit-reason:"
58 #define PCMK_DEFAULT_AGENT_VERSION "0.1"
251 guint interval_ms,
int timeout );
272 const char *provider,
const char *agent,
273 const char *
action, guint interval_ms,
274 int timeout , GHashTable *params,
328 int timeout, GHashTable *params,
329 int sequence,
void *cb_data);
333 static inline const char *services_lrm_status_str(
enum op_status status) {
345 default:
return "UNKNOWN!";
349 static inline const char *services_ocf_exitcode_str(
enum ocf_exitcode code) {
356 return "invalid parameter";
358 return "unimplemented feature";
360 return "insufficient privileges";
362 return "not installed";
364 return "not configured";
366 return "not running";
370 return "master (failed)";
374 return "OCF_NOT_SUPPORTED";
376 return "OCF_PENDING";
378 return "OCF_CANCELLED";
380 return "OCF_TIMEOUT";
382 return "OCF_OTHER_ERROR";
384 return "OCF_DEGRADED";
386 return "OCF_DEGRADED_MASTER";
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.
@ PCMK_LRM_OP_NOT_CONNECTED
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_async_fork_notify(svc_action_t *op, void(*action_callback)(svc_action_t *), void(*action_fork_callback)(svc_action_t *))
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.
gboolean resources_agent_exists(const char *standard, const char *provider, const char *agent)
GList * resources_list_providers(const char *standard)
Get a list of providers.