當建立資源時並且當叢集管理員更新資源的特性或其包含的群組時,RGM 將呼叫 Validate 方法。在套用建立或更新之前,RGM 將呼叫 Validate,並且此方法在任何節點上的故障結束碼均將導致取消建立或取消更新。
僅當叢集管理員變更資源或資源群組特性時,或當監視器設定 Status 和 Status_msg 資源特性時,RGM 才呼叫 Validate。當 RGM 設定特性時,RGM 不呼叫 Validate。
每當 PROBE 方法嘗試容錯移轉資料服務至新節點時,Monitor_check 方法也將明確地呼叫 Validate 方法。
RGM 使用附加引數對傳送至其他方法的引數 (包含正在更新的特性和值) 呼叫 Validate。在 xfnts_validate 開始時對 scds_handle 的呼叫剖析 RGM 傳送至 xfnts_validate 的所有引數並將資訊儲存在 scds_initialize() 中。xfnts_validate 呼叫的子常式使用此資訊。
xfnts_validate 方法呼叫 svc_validate(),以驗證以下情況︰
已經為資源設定了 Confdir_list 特性,該特性定義單一目錄。
scha_str_array_t *confdirs;
confdirs = scds_get_ext_confdir_list(scds_handle);
/* Return error if there is no confdir_list extension property */
if (confdirs == NULL || confdirs->array_cnt != 1) {
scds_syslog(LOG_ERR,
"Property Confdir_list is not set properly.");
return (1); /* Validation failure */
}
Confdir_list 指定的目錄包含 fontserver.cfg 檔案。
(void) sprintf(xfnts_conf, "%s/fontserver.cfg", confdirs->str_array[0]);
if (stat(xfnts_conf, &statbuf) != 0) {
/*
* suppress lint error because errno.h prototype
* is missing void arg
*/
scds_syslog(LOG_ERR,
"Failed to access file <%s> : <%s>",
xfnts_conf, strerror(errno)); /*lint !e746 */
return (1);
}
在叢集節點上可以存取伺服器常駐程式二進位檔。
if (stat("/usr/openwin/bin/xfs", &statbuf) != 0) {
scds_syslog(LOG_ERR,
"Cannot access XFS binary : <%s> ", strerror(errno));
return (1);
}
Port_list 特性指定單一連接埠。
scds_port_list_t *portlist;
err = scds_get_port_list(scds_handle, &portlist);
if (err != SCHA_ERR_NOERR) {
scds_syslog(LOG_ERR,
"Could not access property Port_list: %s.",
scds_error_string(err));
return (1); /* Validation Failure */
}
#ifdef TEST
if (portlist->num_ports != 1) {
scds_syslog(LOG_ERR,
"Property Port_list must have only one value.");
scds_free_port_list(portlist);
return (1); /* Validation Failure */
}
#endif
包含資料服務的資源群組也包含至少一個網路位址資源。
scds_net_resource_list_t *snrlp;
if ((err = scds_get_rs_hostnames(scds_handle, &snrlp))
!= SCHA_ERR_NOERR) {
scds_syslog(LOG_ERR,
"No network address resource in resource group: %s.",
scds_error_string(err));
return (1); /* Validation Failure */
}
/* Return an error if there are no network address resources */
if (snrlp == NULL || snrlp->num_netresources == 0) {
scds_syslog(LOG_ERR,
"No network address resource in resource group.");
rc = 1;
goto finished;
}
在傳回之前,svc_validate() 將釋放所有分配的資源。
finished: scds_free_net_list(snrlp); scds_free_port_list(portlist); return (rc); /* return result of validation */
結束之前,xfnts_validate 方法將呼叫 scds_close(),以收回由 scds_initialize() 配置的資源。scds_initialize() 函數 和 scds_close(3HA) 線上手冊包含更多資訊。