在使数据服务样例联机之后,RGM 将调用 Monitor_start 方法来启动 dns_probe 方法。
本小节介绍了应用程序样例中的 Monitor_start 方法的重要方面, 但未介绍所有回叫方法都通用的功能,例如 parse_args() 函数和获取 syslog 工具,这些在为所有方法提供通用功能中介绍。
要获得 Monitor_start 方法的完整列表,请参阅Monitor_start 方法。
此方法使用进程监视工具 (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 |