Service management facility was first introduced in Solaris 10 for managing system and application services. This replaces the legacy init scripts and other startup scripts. The post discusses few basic troubleshooting techniques to resolve the SMF (Service Management Facility) related issues.
Logfiles, Manifests and Methods
1. SMF logfiles can be found in the following locations:
/var/svc/log /etc/svc/volatile
2. The SMF manifests and methods may be found here:
/var/svc/manifest/* /lib/svc/method/*
3. To see the log file location for a given service use:
# svcs -l| grep logfile
Daemons, Configuration and Recovery
The primary daemons for SMF are svc.startd and svc.configd. At boot time the kernel will start init, which in turn starts svc.startd and that starts svc.configd. This latter daemon (svc.configd) will read information from the repository in /etc/svc/repository.db which is then used by svc.startd to start the services. If there is a problem booting the system you should try:
ok> boot -m milestone=none
Then try to reach milestone “single-user” by running:
# svcadm milestone svc:/milestone/single-user:default
Observe the services as they start, look at any messages on screen and consult the error logs for more information.
If the repository is corrupt you may need to restore from a previous saved copy, or reseed it.
# /lib/svc/bin/restore_repository
The script will guide you through the process.
Service dependencies
If a service fails to start, check the state of the service instance. If a service is in maintenance mode use:
# svcs -xv
This displays services which are in maintenance mode. You can check the reason for them to be in maintenance mode and after resolving the issue you can clear the service out of maintenance mode:
# svcadm clear
Service may depend on other service(s). Unless these services are not online, the dependent service will not start. To check dependent services (Service I depend on)
# svcs -d /system/filesystem/local STATE STIME FMRI online 20:08:17 svc:/system/filesystem/minimal:default online 20:08:19 svc:/milestone/single-user:default
To check which services depends on a particular service (Services that depend on me) :
# svcs -D /system/filesystem/local online 20:08:19 svc:/network/shares/group:default online 20:08:19 svc:/system/cron:default online 20:08:19 svc:/application/opengl/ogl-select:default online 20:08:20 svc:/network/nfs/status:default ......