h1. Introduction to SMF Demo (5 Minutes)
h4. Description
This demo introduces the Service management facility, which replaces the original rc.d scripts.
h4. OpenSolaris Versions Supported
2008.05 or newer.
h4. Points to Hit
* SMF is better than rc.d scripts
* SMF can handle dependencies
* SMF can restart processes in case they fail
* SMF is easy to administer and you can get access to log files fast
* For SMF basics see e.g.: [http://en.wikipedia.org/wiki/Service_Management_Facility]
h4. Demo Prep
No setup necessary.
h4. Gotchas
None known.
h4. Demo
* Start the GUI via *System* > *Administration* > *Services*:
!!Screenshot-SMFServices.png!!
* For more on using the GUI, see the SMF GUI Intro demo script.
* List available services by running *svcs \| more*. Explain what users see in the listing and what is an FMRI (Fault Management Resource Identifier)
* Show the total number of enabled services by running *svcs | wc -l*.
* Show the total number of services available by running *svcs -a | wc -l*.
* Check if any services failed by running *svcs \-x*. The list should be empty on a healthy system.
* Look for the sendmail service - *svcs \| grep sendmail*. You'll get the FMRI: svc:/network/smtp:sendmail
* Find all processes related to this service - *svcs \-p sendmail*. Get the process IDs.
* Kill both sendmail processes by running *pfexec kill ID*, where the ID is the number you got in previous step.
* The processes will be restarted automatically. Verify they are running again by using *svcs \-p sendmail*. There should be new process IDs. Explain what just happened - SMF takes care of restarting the service for you, which is why we see new process IDs.
* Get more info about the service by running *svcs \-l sendmail*. Point out the dependencies: sendmail cannot run without svc:/network/service, etc.
* Point out the other information: the log file location, etc.
* View the logfile, copying the location from the svcs \-l output.
* Disable sendmail (after all, we're just running on a laptop, not a server :-) ) with *svcadm disable sendmail*.
* Use *svcs \-x sendmail* to view the service state. Note the Reason will be "Disabled by an administrator".
* Use *svcs \-p sendmail* to show that the processes are gone.
* Use *svcadm enable sendmail* to restore your system to its original state.
Note, *mysql* also works well with this demo.
h4. Demo Cleanup
None
h4. Description
This demo introduces the Service management facility, which replaces the original rc.d scripts.
h4. OpenSolaris Versions Supported
2008.05 or newer.
h4. Points to Hit
* SMF is better than rc.d scripts
* SMF can handle dependencies
* SMF can restart processes in case they fail
* SMF is easy to administer and you can get access to log files fast
* For SMF basics see e.g.: [http://en.wikipedia.org/wiki/Service_Management_Facility]
h4. Demo Prep
No setup necessary.
h4. Gotchas
None known.
h4. Demo
* Start the GUI via *System* > *Administration* > *Services*:
!!Screenshot-SMFServices.png!!
* For more on using the GUI, see the SMF GUI Intro demo script.
* List available services by running *svcs \| more*. Explain what users see in the listing and what is an FMRI (Fault Management Resource Identifier)
* Show the total number of enabled services by running *svcs | wc -l*.
* Show the total number of services available by running *svcs -a | wc -l*.
* Check if any services failed by running *svcs \-x*. The list should be empty on a healthy system.
* Look for the sendmail service - *svcs \| grep sendmail*. You'll get the FMRI: svc:/network/smtp:sendmail
* Find all processes related to this service - *svcs \-p sendmail*. Get the process IDs.
* Kill both sendmail processes by running *pfexec kill ID*, where the ID is the number you got in previous step.
* The processes will be restarted automatically. Verify they are running again by using *svcs \-p sendmail*. There should be new process IDs. Explain what just happened - SMF takes care of restarting the service for you, which is why we see new process IDs.
* Get more info about the service by running *svcs \-l sendmail*. Point out the dependencies: sendmail cannot run without svc:/network/service, etc.
* Point out the other information: the log file location, etc.
* View the logfile, copying the location from the svcs \-l output.
* Disable sendmail (after all, we're just running on a laptop, not a server :-) ) with *svcadm disable sendmail*.
* Use *svcs \-x sendmail* to view the service state. Note the Reason will be "Disabled by an administrator".
* Use *svcs \-p sendmail* to show that the processes are gone.
* Use *svcadm enable sendmail* to restore your system to its original state.
Note, *mysql* also works well with this demo.
h4. Demo Cleanup
None