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

Class implementing resource commands. More...

Collaboration diagram for ResourceLSB class:

Functions

FSTATIC void _resourcelsb_finalize (AssimObj *aself)
 Finalize function for ResourceLSB objects. More...
 
FSTATIC void _resourcelsb_execute (ResourceCmd *cmdself)
 Do the deed, dude! More...
 
FSTATIC void _resourcelsb_metadata (ResourceLSB *self)
 Return overly-simplified faked-up metadata for an LSB resource. More...
 
FSTATIC void _resourcelsb_validate_all (ResourceLSB *self)
 Fake validate-all action - just return success... More...
 
FSTATIC void _resourcelsb_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...
 
ResourceCmdresourcelsb_new (guint structsize, ConfigContext *request, gpointer user_data, ResourceCmdCallback callback)
 Constructor for ResourceLSB class. More...
 
typedef struct _ResourceLSB ResourceLSB
 

Detailed Description

Class implementing resource commands.

Typedef Documentation

typedef struct _ResourceLSB ResourceLSB

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 43 of file resourcelsb.h.

Function Documentation

FSTATIC void _resourcelsb_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 274 of file resourcelsb.c.

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

Referenced by _resourcelsb_execute().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _resourcelsb_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 143 of file resourcelsb.c.

References __FUNCTION__, _resourcelsb_child_notify(), _resourcelsb_metadata(), _resourcelsb_validate_all(), CASTTOCLASS, CHILD_LOGALL, CHILD_NOLOG, childprocess_new(), DEBUGMSG, DEBUGMSG3, DEBUGMSG5, g_get_monotonic_time(), METADATAOP, MONITOROP, REF2, UNREF, and VALIDATEOP.

Referenced by resourcelsb_new().

Here is the call graph for this function:

Here is the caller graph for this function:

void _resourcelsb_finalize ( AssimObj aself)

Finalize function for ResourceLSB objects.

Definition at line 111 of file resourcelsb.c.

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

Referenced by resourcelsb_new().

Here is the caller graph for this function:

FSTATIC void _resourcelsb_metadata ( ResourceLSB self)

Return overly-simplified faked-up metadata for an LSB resource.

Todo:
We really ought to scan it for comments describing the init script - the LSB requires them, but we should use them if present, and give some dumb default if they're not.

Definition at line 207 of file resourcelsb.c.

References __FUNCTION__, DEBUGMSG2, EXITED_ZERO, and REQTYPENAMEFIELD.

Referenced by _resourcelsb_execute().

Here is the caller graph for this function:

FSTATIC void _resourcelsb_validate_all ( ResourceLSB self)

Fake validate-all action - just return success...

Definition at line 248 of file resourcelsb.c.

References __FUNCTION__, DEBUGMSG2, and EXITED_ZERO.

Referenced by _resourcelsb_execute().

Here is the caller graph for this function:

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

Constructor for ResourceLSB class.

Its main function is to validate that this type of LSB resource agent exists. It will return NULL if this type of LSB 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 resourcelsb.c.

References __FUNCTION__, _AssimObj::_finalize, _resourcelsb_execute(), _resourcelsb_finalize(), _ResourceCmd::baseclass, BINDDEBUG, _ResourceCmd::execute, _ConfigContext::getstring, LSB_ROOT, MONITOROP, NEWSUBCLASS, REQTYPENAMEFIELD, resourcecmd_constructor(), and STATUSOP.

Here is the call graph for this function: