by Ras
3. April 2012 22:19
# Service Management Facility
What does it do?
provides service management via service configuration databse
provides legacy rc script support
facilitates service dependancies
permits automatic restarts of failed and/or stopped services
provide service status info (online/offline, dependencies)
causes each defined service to log individually to /var/svc/log
defines a fault management resource identifier (FMRI)
can load mutually exclusive services in parallel
Services States:
1- Online/Offline
2- Legacy_run/maintenace
3- uninitialized/degraded/disabled
Primary SMF utilities
svcs - lists services and providers additional info
svcadm - permits interaction with services, including state transitions
svccfg - permits interaction with service configuration database
svc.startd - is the default service restarter/manager
inetadm - is the default, delegated service restater for inetd
FMRIs provide categories for services including
1- network
2- milestone
svcs -d svc:/network/smtp:sendmail # shows service dependancy for sendmail
svcs -D svc:/network/smtp:sendmail # shows service depend on sendmail
svcs -l smtp - FRMIs can usally be referenced by their unique parts
svcs -x smtp - Brief information about the service
svcs -p smtp - will show the PID for smtp
log files located at /var/svc/log/
##svcadm
Diable service:
svcadm disable FMRI
svcadm disable -s FMRI # stops each service instance
svcadm disable -t FMRI # effects temporary disable
svcadm delegates service management to default restarter, ie: svc.startd
Enable a service:
svcadm enable FMRI
svcadm enable -t FMRI # enables FMRI for current session
svcadm enable -r FMRI # All dependancies are enabled
svcadm enable -s FMRI # enables each service instance
Refresh:
svcadm -v refresh FMRI
Restart:
svcadm -v svcadm restart FMRI
### Service management with inetadmin
inetadm -l FMRI # like svcs -l
inetadm -d FMRI # disable FMRI
inetadm -e FMRI # enable FMRI
inetadm -p # Shows Global directives
### Editing inetd service options
inetadm -m svc:network/tftp/udp6:default exec="/usr/sbin/in.tftpd -s /tftpboot2" # Change options for specific service
inetadm -M max_copies=10 # change global directives (e.g. max_copies)