|
Sunday January 30, 2005 I had brought up the topic of running Tomcat in a zone for students in an educational setting. While not required, it would be nice if Tomcat played nice with the Service Management Facility (SMF). Plus, I'll be doing booth duty talking about Solaris 10 at the AFCEA West 2005. I figure a SMF demo there showing how to integrate existing applications might come in handy. Now, if you really want to learn about SMF, go to those who know much more than me.
While I understand what the benefits of SMF are, this was my first attempt at actually SMF-enabling an application. It's actually pretty easy at an abstract level when you leverage "man smf" and some of the devloper documentation. Another helpful task is to read the actual service description dtd (/usr/share/lib/xml/dtd/service_bundle.dtd.1). Unfortunately the developer documentation doesn't go into much detail yet, but the folks bringing you SMF were working on hard on getting the actual bits out. Expect more documentation to be on it's way.
Here's the net effect of putting Tomcat under SMF control from a lifecycle perspective with some notes:
# svcs tomcat svcs: Pattern 'tomcat' doesn't match any instances STATE STIME FMRI
# svccfg import ./tomcat.xml # svcs tomcat STATE STIME FMRI offline* 13:27:04 svc:/application/tomcat:default
# svcs tomcat STATE STIME FMRI offline* 13:27:11 svc:/application/tomcat:default
# svcs tomcat STATE STIME FMRI online 13:27:16 svc:/application/tomcat:default
# svcs -d tomcat STATE STIME FMRI online 13:21:55 svc:/network/loopback:default online 13:22:09 svc:/network/physical:default online 13:22:21 svc:/system/filesystem/local:default
# svcs -D tomcat STATE STIME FMRI
# svcadm disable physical # svcs tomcat STATE STIME FMRI offline 13:27:50 svc:/application/tomcat:default
# svcs -x tomcat svc:/application/tomcat:default (Tomcat) State: offline since Sun Jan 30 13:27:50 2005 Reason: Service svc:/network/physical:default is disabled. See: http://sun.com/msg/SMF-8000-GE Impact: This service is not running.
# svcadm enable physical # svcs tomcat STATE STIME FMRI online 13:28:16 svc:/application/tomcat:defaultNow that was a fun exercise, wasn't it? So what is the point of all this? Now we don't have this very odd and outdated means of dealing with service lifecycles and inter-relationships in Solaris. There are clean relationships and dependencies between services. If you want to see a neat view of boot ordering and bootup times, check out what Dan Price and Eric Schrock have done, leveraging the work done at bootchart.org (2005-01-30 14:30:45.0) Permalink Comments [7]