I was recently asked how to configure the Solaris 10 Service Management Facility (SMF) to NOT restart directory server, should directory be stopped by dsadm, by kill or if DS quit on its own. In my pursuit of this configuration, I realized that there isn't a single resource that details some of my favorite uses of SMF relative to directory server. Toward that end, I decided to throw this blog entry for your benefit.
Great SMF ResourcesIf you are just getting started on learning SMF, here are some great resources to get you going.
Where To Find SMF Templates For DSDirectory Server Sample SMF Template:
/dsee6-install-dir/ds6/install/tmpl_smf.manifest
Directory Proxy Server Sample SMF Template:
/dsee6-install-dir/dps6/install/tmpl_smf.manifest
How To Disable SMF Auto-restart1. Save frmi into variable
# fmri="svc:/application/sun/ds:default"
2. Dump the fmri xml to a file
# svccfg export ${fmri} > /ds-fmri.xml
3. Modify /ds-fmri.xml adding the following after the <stability... property.
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='transient'/>
</property_group>
4. Delete the current entry with sccfg
# svccfg delete ${fmri}
5. Import the updated fmri xml file...
# svccfg import /ds-fmri.xml
6. Enable the fmri...
# svccfg enable ${fmri}
Note that if you stop or kill ds outside of svcadm (e.g. smf) the state will not change from 'online'. Here is sample output from my system.
# svcs ds
STATE STIME FMRI
online 13:35:04 svc:/application/sun/ds:default
Reference:
Service Management Facility master restarter
How To Partially Disable Auto RestartIf you installed from native packages with the Java Enterprise System distribution, enable the server to restart when the operating system reboots.
# dsadm enable-service --type SMF /ds_instance
Note that that with this feature, "dsadm stop /ds_instance" will stop DS and disable the service so that the restarter won't try to re-start ds. However, if DS is killed or dies, the restarter will attempt to re-start DS.
Reference:
Creating and deleting a directory server instance
How To Start DS Using libumemIf for troubleshooting purposes, you want to switch to the object-caching memory allocation library (libumem), use the following to make the change in SMF:
# svccfg -s svc:/application/sun/ds:default setenv LD_PRELOAD_32 libumem.so
# svccfg -s svc:/application/sun/ds:default setenv LD_PRELOAD_64 /usr/lib/64/libumem.so
Then, refresh and restart the DS instance in order for this change to take effect.
# svcadm refresh svc:/application/sun/ds:default
# svcadm restart svc:/application/sun/ds:default
Use the following to see the changes:
# svcprop ds| grep LD_
start/environment astring LD_PRELOAD_32=libumem.so LD_PRELOAD_64=/usr/lib/64/libumem.so
How To Start DS On Fixed Priority SchedulerIf you would like to start DS with the fixed priority scheduler instead of the default fare share scheduler, simply insert the appropriate priocntl command into the exec_method string of the start method. Here is the excerpt of our working fmri example.
<exec_method
type="method"
name="start"
exec="/opt/SUNWdsee/ds6/bin/dsadm start --exec /dsAtt"
timeout_seconds="600">
Here is what it looks like after we have added priocntl:
<exec_method
type="method"
name="start"
exec="priocntl -e -c FX /opt/SUNWdsee/ds6/bin/dsadm start --exec /ds"
timeout_seconds="600">
To actually make the change, use the method described above in "How To Disable SMF Auto-restart"
Now, you can see from the process listing that the schedule used is the FX scheduler.
# ps -c -p 6033
PID CLS PRI TTY TIME CMD
6033 FX 0 ? 0:00 ns-slapd
Set NDD Settings On System BootAfter installing DS, one of the first things that you need to do is optimize the system wide TCP/IP settings for directory server. You can determine the settings that make the most sense for your system by running idsktune. Take those settings and plug them into a script that will be called on system boot once by SMF. Details on this procedure are well documented in the
Deployment Planning Guide.
I hope that you find this information useful.
Blessings to you and yours.
Brad