SMF for Solaris 10

From Cfwiki

Jump to: navigation, search

SMF Manifests

An SMF manifest that allows you to start cfexecd, cfservd and cfenvd: PSAsmf-cfengine.

It also allows various options (such as the config file for cfservd and histograms for cfenvd) to be set.

Interacting with SMF

The following snipet shows how to test for the activation of a service and disable if it is enabled (i.e. disable telnet on production servers):

control:
	telnet_state = ( ExecResult(/usr/bin/svcs telnet) )
	ftp_state = ( ExecResult(/usr/bin/svcs ftp) )

classes:
	telnet_enabled = ( Regcmp(".*online.*",${telnet_state}) )
	ftp_enabled = ( Regcmp(".*online.*",${ftp_state}) )

shellcommands:
 telnet_enabled::
 	"/usr/sbin/svcadm disable telnet" useshell=false
 ftp_enabled::
 	"/usr/sbin/svcadm disable ftp" useshell=false
Personal tools