The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ResourceOCF class

Class implementing resource commands. More...

Collaboration diagram for ResourceOCF class:

Functions

FSTATIC void _resourceocf_finalize (AssimObj *aself)
 Finalize function for ResourceOCF objects. More...
 
FSTATIC void _resourceocf_execute (ResourceCmd *cmdself)
 Do the deed, dude! More...
 
FSTATIC void _resourceocf_child_notify (ChildProcess *child, enum HowDied exittype, int rc, int signal, gboolean core_dumped)
 We get called when our child exits, times out and is killed, or times out and can't be killed. More...
 
FSTATIC gboolean _resourceocf_outputs_string (const char *operation)
 
FSTATIC void _resourceocf_init_environ (ResourceOCF *self)
 
ResourceCmdresourceocf_new (guint structsize, ConfigContext *request, gpointer user_data, ResourceCmdCallback callback)
 Constructor for ResourceOCF class. More...
 
#define MONITOROP   "monitor"
 
#define METADATAOP   "meta-data"
 
#define OCF_ROOT   "/usr/lib/ocf"
 
#define OCF_RES_D   "resource.d"
 
#define HB_RSCTMPDIR   "/var/lib/heartbeat/lrm"
 
typedef struct _ResourceOCF ResourceOCF
 

Detailed Description

Class implementing resource commands.

Macro Definition Documentation

#define HB_RSCTMPDIR   "/var/lib/heartbeat/lrm"

Definition at line 57 of file resourceocf.h.

Referenced by _resourceocf_init_environ().

#define METADATAOP   "meta-data"

Definition at line 43 of file resourceocf.h.

#define MONITOROP   "monitor"

It does not implement any queueing, repeating events or such things. It creates an object which will execute the resource action immediately when asked. If this class invoked without any sort of queueing mechanism, or other safeguards it can break the semantics of the underlying resources.

Resources are expected to assume that no more than one resource action can be active at a time for any given resource instance.

Definition at line 42 of file resourceocf.h.

#define OCF_RES_D   "resource.d"

Definition at line 56 of file resourceocf.h.

Referenced by resourceocf_new().

#define OCF_ROOT   "/usr/lib/ocf"

Definition at line 55 of file resourceocf.h.

Referenced by _resourceocf_init_environ(), and resourceocf_new().

Typedef Documentation

typedef struct _ResourceOCF ResourceOCF

Definition at line 45 of file resourceocf.h.

Function Documentation

FSTATIC void _resourceocf_child_notify ( ChildProcess child,
enum HowDied  exittype,
int  rc,
int  signal,
gboolean  core_dumped 
)

We get called when our child exits, times out and is killed, or times out and can't be killed.

Definition at line 283 of file resourceocf.c.

References __FUNCTION__, CASTTOCLASS, DEBUGMSG2, DEBUGMSG5, EXITED_ZERO, g_get_monotonic_time(), MONITOROP, UNREF2, and _ChildProcess::user_data.

Referenced by _resourceocf_execute().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _resourceocf_execute ( ResourceCmd self)

Do the deed, dude!

< cpsize

< char** argv,

< const char** envp

< ConfigContext* envmod

< const char* curdir

< void (notify)(ChildProcess,enum HowDied,int rc,int signal,gboolean core_dumped)

< gboolean save_stdout

< const char * logdomain

< const char * logprefix

< GLogLevelFlags loglevel

< guint32 timeout_seconds,

< gpointer user_data

< enum ChildErrLogMode errlogmode

< const char * loggingname

Definition at line 228 of file resourceocf.c.

References __FUNCTION__, _resourceocf_child_notify(), _resourceocf_outputs_string(), CASTTOCLASS, CHILD_LOGALL, CHILD_NOLOG, childprocess_new(), DEBUGMSG, DEBUGMSG3, DEBUGMSG5, g_get_monotonic_time(), REF2, and UNREF.

Referenced by resourceocf_new().

Here is the call graph for this function:

Here is the caller graph for this function:

void _resourceocf_finalize ( AssimObj aself)

Finalize function for ResourceOCF objects.

Definition at line 177 of file resourceocf.c.

References __FUNCTION__, CASTTOCLASS, DEBUGMSG, DEBUGMSG2, DEBUGMSG5, and UNREF.

Referenced by resourceocf_new().

Here is the caller graph for this function:

FSTATIC void _resourceocf_init_environ ( ResourceOCF self)

Definition at line 128 of file resourceocf.c.

References __FUNCTION__, _ConfigContext::baseclass, _ConfigContext::getstring, HB_RSCTMPDIR, _ConfigContext::keys, OCF_ROOT, and REQENVIRONNAMEFIELD.

Referenced by resourceocf_new().

Here is the caller graph for this function:

FSTATIC gboolean _resourceocf_outputs_string ( const char *  operation)

Definition at line 210 of file resourceocf.c.

References DIMOF, METADATAOP, and MONITOROP.

Referenced by _resourceocf_execute().

Here is the caller graph for this function:

ResourceCmd* resourceocf_new ( guint  structsize,
ConfigContext request,
gpointer  user_data,
ResourceCmdCallback  callback 
)

Constructor for ResourceOCF class.

Its main function is to validate that this type of OCF resource agent exists. It will return NULL if this type of OCF RA doesn't exist.

Parameters
structsizeStructure size (or zero)
requestRequest to instantiate
user_dataUser data for 'callback'
callbackCallback when complete

Definition at line 49 of file resourceocf.c.

References __FUNCTION__, _AssimObj::_finalize, _resourceocf_execute(), _resourceocf_finalize(), _resourceocf_init_environ(), _ResourceCmd::baseclass, BINDDEBUG, CFG_CFGCTX, CFG_EEXIST, configcontext_new(), CONFIGNAME_TYPE, _ResourceCmd::execute, _ConfigContext::getstring, _ConfigContext::gettype, NEWSUBCLASS, OCF_RES_D, OCF_ROOT, REQENVIRONNAMEFIELD, REQPROVIDERNAMEFIELD, and resourcecmd_constructor().

Here is the call graph for this function: