Svcadm Command
The svcadm command is a powerful utility in Solaris (and illumos-based systems) used for managing service instances within the Service Management Facility (SMF). It allows administrators to control the lifecycle of services, ensuring system stability and proper operation.
Enable Solaris Services
To make a service available and start it if it's not running, use the enable subcommand. This is often the first step after installing a new service or after a service has been disabled.
# svcadm enable service_name
Disable Solaris Services
To prevent a service from starting automatically at boot and to stop it if it's currently running, use the disable subcommand. This is useful for temporarily taking a service offline or for troubleshooting.
# svcadm disable service_name
Restart Solaris Services
If a service is misbehaving or needs to be reloaded with its configuration, the restart subcommand is used. This command stops the service and then starts it again.
# svcadm restart service_name
Refresh Solaris Services
The refresh subcommand tells a running service to re-read its configuration files. This is a less disruptive way to apply configuration changes compared to a full restart.
# svcadm refresh service_name
Clear Service Maintenance State
When a service enters a maintenance state due to errors, the clear subcommand can be used to reset its state and attempt to start it again. This is crucial for recovering services that have failed.
# svcadm clear service_name
Understanding and utilizing the svcadm command is fundamental for effective Solaris system administration. It provides granular control over the services that power your operating environment.