RGM 调用 Monitor_start 方法,以在使数据服务样例联机之后启动 dns_probe 方法。
本节介绍样例应用程序的 Monitor_start 方法的主要方面。本节没有介绍所有回调方法通用的功能,例如 parse_args() 函数。本节也没有介绍 syslog() 函数的使用。通用功能在为所有方法提供通用功能中进行介绍。
有关 Monitor_start 方法的完整列表,请参见Monitor_start 方法代码列表。
该方法使用 PMF (pmfadm) 来启动探测。
Monitor_start 方法获取 RT_basedir 属性的值,用来为 PROBE 程序构造完整的路径名。该方法通过使用 pmfadm 的无限重试选项(-n -1、-t -1)启动探测,意味着如果探测无法启动,PMF 将在无限时间期限内无限次地启动探测。
# Find where the probe program resides by obtaining the value of the # RT_basedir property of the resource. RT_BASEDIR=`scha_resource_get -O RT_basedir -R $RESOURCE_NAME -G \ $RESOURCEGROUP_NAME` # Start the probe for the data service under PMF. Use the infinite retries # option to start the probe. Pass the resource name, type, and group to the # probe program. pmfadm -c $RESOURCE_NAME.monitor -n -1 -t -1 \ $RT_BASEDIR/dns_probe -R $RESOURCE_NAME -G $RESOURCEGROUP_NAME \ -T $RESOURCETYPE_NAME