Tuesday, August 18, 2009

Simplifying OpenDS SMF Management

A friend recently asked me how easy it would be to service management facility (SMF) enable OpenDS for Solaris 10. I initially assumed that this support existed natively in the OpenDS bundle. Apparently, SMF support can be there depending on the build process used for building OpenDS. However, it is not there by default in the current builds of OpenDS 1.2 and 2.0.0. After discussing with engineering, they plan to address this in a future release of OpenDS. In the interim I threw together a script called opends-smf to simplify SMF enabling of OpenDS instances. Run the script with the -h flag to see the proper usage and syntax. For reference though, here are a few usage examples:

1. List all SMF managed OpenDS instances:
# ./opends-smf -a list
STATE STIME FMRI
online 3:22:13 svc:/network/opends/server:ds2

2. SMF enable OpenDS instance ds1:
# ./opends-smf -a enable -n ds1 -i /ds1
# ./opends-smf -a list
STATE STIME FMRI
online 3:22:13 svc:/network/opends/server:ds2
online 1:50:00 svc:/network/opends/server:ds1

3. Disable ds1
# ./opends-smf -a disable -n ds1
# ./opends-smf -a list
STATE STIME FMRI
disabled 1:59:06 svc:/network/opends/server:ds1
online 3:22:13 svc:/network/opends/server:ds2

4. Remove ds1 from SMF control:
# ./opends-smf -a unconfigure -n ds1
# ./opends-smf -a list
STATE STIME FMRI
online 3:22:13 svc:/network/opends/server:ds2

Enjoy!

Brad

PS: Please note that this is simply an example of how you could SMF enable OpenDS instances and is not a supported script either by me or Sun Microsystems, Inc.

No comments: