Solaris SMF Manifest for EZproxy
Solaris Service Management Facility
Starting with Solaris 10, system services are controlled by the Service Management Facility. This facility simplifies management and control of non-interactive services such as EZproxy. Institutions running EZproxy on Solaris 10 may wish to have EZproxy controlled by SMF.
This article will not tell you all you need to know about Solaris 10's Service Management Facility. It is intended only as a guide for getting started in implementing an SMF manifest for EZproxy. You can read more about SMF by following links in the further reading section.
These instructions have only been tested on a non-production server and you should do your own tests before running live with this.
Create the SMF service
Service configuration files
Copy the manifest file for EZproxy to the site-specific manifest location:
# mkdir -p /var/svc/manifest/site/application # cp ezproxy.xml /var/svc/manifest/site/application/ezproxy.xml
Create a symbolic link to your EZproxy program file for use by SMF when starting, stopping or restarting the EZproxy process:
# ln -s /your/ezproxy/binary /lib/svc/method/ezproxy
The manifest file provided on this page depends on the existence of this symbolic link.
Importing the service into SMF
Once you have the manifest file in place, and the symbolic link created, you can import the manifest into the service configuration repository.
Firstly, use svccfg to validate the manifest file before importing:
# svccfg validate /var/svc/manifest/site/application/ezproxy.xml
Be sure to fix any errors reported by svccfg.
Next, import the service configuration into the repository:
# svccfg import /var/svc/manifest/site/application/ezproxy.xml
Check that the manifest was imported successfully:
#svcs ezproxy STATE STIME FMRI disabled 12:10:37 svc:/site/application/ezproxy:default
Or if you prefer more detail, you can run svcs verbosely:
# svcs -vx ezproxy svc:/site/application/ezproxy:default (EZproxy server) State: disabled since Fri Apr 21 12:10:37 2006 Reason: Disabled by an administrator. See: http://sun.com/msg/SMF-8000-05 Impact: This service is not running.
Starting the new service
You can now start the SMF-controlled EZproxy process:
# svcadm enable ezproxy
If all goes well, running svcs you will see:
# svcs -vx ezproxy svc:/site/application/EZproxy:default (ezproxy server) State: online since Fri Apr 21 12:11:57 2006 See: /var/svc/log/site-application-ezproxy:default.log Impact: None.
To Do: Explain what happens if all does not go well ;)
The manifest file (ezproxy.xml)
This is the ezproxy.xml manifest file that you can copy and use on your Solaris 10 server:
<?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <!-- Copyright 2006 RMIT University Library, All rights reserved. Solaris service manifest for EZproxy EZproxy.xml : Ben Couldrey, ben.couldrey [at] rmit.edu.au Note, you should do a few things before this manifest will work: 1. Choose an appropriate FMRI, I've chosen the site-specifc location 2. Create a symbolic link in /lib/svc/method pointing to your EZproxy binary (ln -s /your/ezproxy/binary /lib/svc/method/ezproxy) 3. Add, change or delete the instance dependencies as necessary for your system 4. Test, test, test. --> <service_bundle type='manifest' name='ezproxy'> <service name='site/application/ezproxy' type='service' version='1'> <single_instance /> <instance name='default' enabled='false'> <dependency name='loopback' grouping='require_all' restart_on='error' type='service'> <service_fmri value='svc:/network/loopback:default'/> </dependency> <dependency name='physical' grouping='optional_all' restart_on='error' type='service'> <service_fmri value='svc:/network/physical:default'/> </dependency> <exec_method type='method' name='start' exec='/lib/svc/method/ezproxy start' timeout_seconds='60' /> <exec_method type='method' name='stop' exec='/lib/svc/method/ezproxy stop' timeout_seconds='60' /> <exec_method type='method' name='restart' exec='/lib/svc/method/ezproxy restart' timeout_seconds='60' /> </instance> <stability value='Evolving' /> <template> <common_name> <loctext xml:lang='C'> EZproxy server </loctext> </common_name> <documentation> <doc_link name='usefulutilities.com' uri='http://www.usefulutilities.com' /> </documentation> </template> </service> </service_bundle>
Check the manual pages of the utilities referenced on this page: