Sun Cluster 3.1 Data Services Developer's Guide

Debugging the Resource Type Implementation

The DSDL has built-in features to help you debug your data service.

The DSDL utility scds_syslog_debug() provides a basic framework for adding debugging statements to the resource type implementation. The debugging level (a number between 1-9) can be dynamically set per resource type implementation per cluster node. A file named /var/cluster/rgm/rt/<rtname>/loglevel containing only an integer between 1-9 is read by all resource type callback methods. The DSDL routine scds_initialize() reads this file and sets the debug level internally to the specified level. The default debug level 0, specifies that the data service log no debugging messages.

The scds_syslog_debug() function uses the facility returned by the scha_cluster_getlogfacility(3HA) function at a priority of LOG_DEBUG. You can configure these debug messages in /etc/syslog.conf.

You can turn some debugging messages into informational messages for regular operation of the resource type (perhaps at LOG_INFO priority) using the scds_syslog utility. If you look at the sample DSDL application in Chapter 8, Sample DSDL Resource Type Implementation you will notice that it makes liberal use of scds_syslog_debug and scds_syslog functions.