Merge "Add fd-limit-reached degraded condition for open-ldap service"

This commit is contained in:
Zuul 2021-12-02 17:04:15 +00:00 committed by Gerrit Code Review
commit a39b69f317
4 changed files with 12 additions and 0 deletions

View File

@ -309,6 +309,7 @@ _sm_service_group_condition_mappings[SM_SERVICE_GROUP_CONDITION_MAX] =
{ SM_SERVICE_GROUP_CONDITION_RECOVERY_FAILURE, "recovery-failure" },
{ SM_SERVICE_GROUP_CONDITION_ACTION_FAILURE, "action-failure" },
{ SM_SERVICE_GROUP_CONDITION_FATAL_FAILURE, "fatal-failure" },
{ SM_SERVICE_GROUP_CONDITION_FD_LIMIT_REACHED, "FD-limit-reached" },
};
static SmValueStrMappingT
@ -414,6 +415,7 @@ _sm_service_condition_mappings[SM_SERVICE_CONDITION_MAX] =
{ SM_SERVICE_CONDITION_RECOVERY_FAILURE, "recovery-failure" },
{ SM_SERVICE_CONDITION_ACTION_FAILURE, "action-failure" },
{ SM_SERVICE_CONDITION_FATAL_FAILURE, "fatal-failure" },
{ SM_SERVICE_CONDITION_FD_LIMIT_REACHED, "FD-limit-reached" },
};
static SmValueStrMappingT

View File

@ -458,6 +458,7 @@ typedef enum
SM_SERVICE_GROUP_CONDITION_RECOVERY_FAILURE,
SM_SERVICE_GROUP_CONDITION_ACTION_FAILURE,
SM_SERVICE_GROUP_CONDITION_FATAL_FAILURE,
SM_SERVICE_GROUP_CONDITION_FD_LIMIT_REACHED,
SM_SERVICE_GROUP_CONDITION_MAX
} SmServiceGroupConditionT;
@ -565,6 +566,7 @@ typedef enum
// recovery-failure: recovery of the service has failed.
// action-failure: a service action has failed.
// fatal-failure: a fatal failure has occured.
// FD-limit-reached: limit of open FD has reached.
typedef enum
{
SM_SERVICE_CONDITION_NIL,
@ -578,6 +580,7 @@ typedef enum
SM_SERVICE_CONDITION_RECOVERY_FAILURE,
SM_SERVICE_CONDITION_ACTION_FAILURE,
SM_SERVICE_CONDITION_FATAL_FAILURE,
SM_SERVICE_CONDITION_FD_LIMIT_REACHED,
SM_SERVICE_CONDITION_MAX
} SmServiceConditionT;

View File

@ -628,6 +628,9 @@ INSERT INTO "SERVICE_ACTION_RESULTS" VALUES('ocf-script','default','stop','5','s
INSERT INTO "SERVICE_ACTION_RESULTS" VALUES('ocf-script','default','demote','5','success','disabled','unknown','unknown');
INSERT INTO "SERVICE_ACTION_RESULTS" VALUES('ocf-script','Filesystem','stop','1','success','disabled','unknown','unknown');
INSERT INTO "SERVICE_ACTION_RESULTS" VALUES('ocf-script','Filesystem','stop','plugin-timeout','success','disabled','unknown','unknown');
INSERT INTO "SERVICE_ACTION_RESULTS" VALUES('lsb-script','openldap','status','0','success','enabled-active','','');
INSERT INTO "SERVICE_ACTION_RESULTS" VALUES('lsb-script','openldap','status','160','success','enabled-active','','');
INSERT INTO "SERVICE_ACTION_RESULTS" VALUES('lsb-script','openldap','status','161','success','enabled-active','degraded','FD-limit-reached');
CREATE TABLE SCHEMA_VERSION (ID INTEGER PRIMARY KEY AUTOINCREMENT, MAJOR INTEGER, MINOR INTEGER);
INSERT INTO "SCHEMA_VERSION" VALUES(2,0,0);
CREATE TABLE CONFIGURATION ( ID INTEGER PRIMARY KEY AUTOINCREMENT, "KEY" CHAR(32), "VALUE" CHAR(32) );

View File

@ -124,6 +124,10 @@ static void sm_service_group_audit_map_service_condition(
*condition = SM_SERVICE_GROUP_CONDITION_FATAL_FAILURE;
break;
case SM_SERVICE_CONDITION_FD_LIMIT_REACHED:
*condition = SM_SERVICE_GROUP_CONDITION_FD_LIMIT_REACHED;
break;
default:
*condition = SM_SERVICE_GROUP_CONDITION_UNKNOWN;
DPRINTFE( "Unknown service condition (%i) given.",