![]() |
pacemaker
1.1.16-94ff4df
Scalable High-Availability cluster resource manager
|
#include <crm_internal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <dirent.h>
#include <fcntl.h>
#include <crm/crm.h>
#include <crm/common/mainloop.h>
#include <crm/services.h>
#include <crm/msg_xml.h>
#include "services_private.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
Functions | |
svc_action_t * | services_action_create (const char *name, const char *action, int interval, int timeout) |
const char * | resources_find_service_class (const char *agent) |
svc_action_t * | resources_action_create (const char *name, const char *standard, const char *provider, const char *agent, const char *action, int interval, int timeout, GHashTable *params, enum svc_action_flags flags) |
Create a new resource action. More... | |
svc_action_t * | services_action_create_generic (const char *exec, const char *args[]) |
void | services_action_cleanup (svc_action_t *op) |
void | services_action_free (svc_action_t *op) |
gboolean | cancel_recurring_action (svc_action_t *op) |
gboolean | services_action_cancel (const char *name, const char *action, int interval) |
gboolean | services_action_kick (const char *name, const char *action, int interval) |
void | services_add_inflight_op (svc_action_t *op) |
gboolean | services_action_async (svc_action_t *op, void(*action_callback)(svc_action_t *)) |
gboolean | is_op_blocked (const char *rsc) |
void | handle_blocked_ops (void) |
gboolean | services_action_sync (svc_action_t *op) |
GList * | get_directory_list (const char *root, gboolean files, gboolean executable) |
Get a list of files or directories in a given path. More... | |
GList * | services_list (void) |
GList * | resources_list_standards (void) |
GList * | resources_list_providers (const char *standard) |
Get a list of providers. More... | |
GList * | resources_list_agents (const char *standard, const char *provider) |
Get a list of resource agents. More... | |
Variables | |
GHashTable * | recurring_actions = NULL |
GList * | blocked_ops = NULL |
GList * | inflight_ops = NULL |
#define _GNU_SOURCE |
Definition at line 11 of file services.c.
gboolean cancel_recurring_action | ( | svc_action_t * | op | ) |
Definition at line 448 of file services.c.
GList* get_directory_list | ( | const char * | root, |
gboolean | files, | ||
gboolean | executable | ||
) |
Get a list of files or directories in a given path.
[in] | root | full path to a directory to read |
[in] | files | return list of files if TRUE or directories if FALSE |
[in] | executable | if TRUE and files is TRUE, only return executable files |
Definition at line 724 of file services.c.
void handle_blocked_ops | ( | void | ) |
Definition at line 651 of file services.c.
gboolean is_op_blocked | ( | const char * | rsc | ) |
Definition at line 635 of file services.c.
svc_action_t* resources_action_create | ( | const char * | name, |
const char * | standard, | ||
const char * | provider, | ||
const char * | agent, | ||
const char * | action, | ||
int | interval, | ||
int | timeout, | ||
GHashTable * | params, | ||
enum svc_action_flags | flags | ||
) |
Create a new resource action.
[in] | name | name of resource |
[in] | standard | resource agent standard (ocf, lsb, etc.) |
[in] | provider | resource agent provider |
[in] | agent | resource agent name |
[in] | action | action (start, stop, monitor, etc.) |
[in] | interval | how often to repeat this action, in milliseconds (if 0, execute only once) |
[in] | timeout | consider action failed if it does not complete in this many milliseconds |
[in] | params | action parameters |
Definition at line 92 of file services.c.
const char* resources_find_service_class | ( | const char * | agent | ) |
Find the first class that can provide service::${agent}
[in] | agent | which agent to search for |
Definition at line 56 of file services.c.
GList* resources_list_agents | ( | const char * | standard, |
const char * | provider | ||
) |
Get a list of resource agents.
[in] | standard | list agents using this standard (e.g. ocf, lsb, etc.) (or NULL for all) |
[in] | provider | list agents from this provider (or NULL for all) |
Definition at line 795 of file services.c.
GList* resources_list_providers | ( | const char * | standard | ) |
Get a list of providers.
[in] | standard | list providers of this standard (e.g. ocf, lsb, etc.) |
Definition at line 785 of file services.c.
GList* resources_list_standards | ( | void | ) |
Get list of available standards
Definition at line 744 of file services.c.
gboolean services_action_async | ( | svc_action_t * | op, |
void(*)(svc_action_t *) | action_callback | ||
) |
Run an action asynchronously.
[in] | op | services action data |
[in] | action_callback | callback for when the action completes |
TRUE | succesfully started execution |
FALSE | failed to start execution, no callback will be received |
Definition at line 607 of file services.c.
gboolean services_action_cancel | ( | const char * | name, |
const char * | action, | ||
int | interval | ||
) |
Definition at line 465 of file services.c.
void services_action_cleanup | ( | svc_action_t * | op | ) |
Definition at line 370 of file services.c.
svc_action_t* services_action_create | ( | const char * | name, |
const char * | action, | ||
int | interval, | ||
int | timeout | ||
) |
Definition at line 50 of file services.c.
svc_action_t* services_action_create_generic | ( | const char * | exec, |
const char * | args[] | ||
) |
Utilize services API to execute an arbitrary command.
This API has useful infrastructure in place to be able to run a command in the background and get notified via a callback when the command finishes.
[in] | exec | command to execute |
[in] | args | arguments to the command, NULL terminated |
Definition at line 318 of file services.c.
void services_action_free | ( | svc_action_t * | op | ) |
Definition at line 406 of file services.c.
gboolean services_action_kick | ( | const char * | name, |
const char * | action, | ||
int | interval | ||
) |
Kick a recurring action so it is scheduled immediately for re-execution
Definition at line 503 of file services.c.
gboolean services_action_sync | ( | svc_action_t * | op | ) |
Definition at line 692 of file services.c.
void services_add_inflight_op | ( | svc_action_t * | op | ) |
Definition at line 592 of file services.c.
GList* services_list | ( | void | ) |
Get a list of services
Definition at line 730 of file services.c.
GList* blocked_ops = NULL |
Definition at line 44 of file services.c.
GList* inflight_ops = NULL |
Definition at line 47 of file services.c.
GHashTable* recurring_actions = NULL |
Definition at line 40 of file services.c.