Brad Macpherson > Solaris-SMF > Solaris::SMF::Service

Download:
Solaris-SMF-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Solaris::SMF::Service - Encapsulate Solaris 10 services in Perl

VERSION ^

Version 0.02

SYNOPSIS ^

Interface to Sun's Service Management Facility in Solaris 10. This module provides a wrapper around 'svcs', 'svcadm' and 'svccfg'.

The SMF in Solaris is a replacement for inetd as well as the runlevel-based stopping and starting of daemons. Service definitions are stored in an XML database.

The biggest advantages in using SMF are the resiliency support, consistent interface and inter-service dependencies it offers. Services that die for any reason can be automatically restarted by the operating system; all services can be enabled or disabled using the same commands; and services can be started as soon as all the services they depend upon have been started, rather than at a fixed point in the boot process.

METHODS ^

new

Create a new Service object. The parameter must be a valid, unique FMRI.

status

Get the current status of this service. Returns a string, 'disabled', 'enabled', 'offline'.

FMRI

Returns the Fault Managed Resource Identifier for this service.

properties

Returns all or some properties for this service.

property

Returns the value of a single property of this service.

property_type

Returns the type of a single property of this service.

disable

This instructs SMF to disable the service permanently. To disable temporarily, that is until the next time the server is rebooted, use the 'stop' method.

stop

This instructs SMF to stop the service. It uses the -t flag to svcadm, so that using this call will not prevent the service from starting the next time the server reboots.

enable

This instructs SMF to enable the service permanently. To enable temporarily, that is until the next time the server is rebooted, see the 'start' method.

start

This instructs SMF to start the service. This change is not made persistent unless you use the 'enable' method.

refresh

This instructs SMF to refresh the service. Needed whenever alterations are made to a service's properties. It acts as the analogue of a SQL 'commit'.

clear

This instructs SMF to clear the service's state, that is, to remove the 'failed' marker from it. This is needed prior to starting a failed service.

mark

This instructs SMF to mark the service as failed.

AUTHOR ^

Brad Macpherson, <brad at teched-creations.com>

BUGS ^

Please report any bugs or feature requests to bug-solaris-smf at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Solaris-SMF. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Solaris::SMF::Service

You can also look for information at:

ACKNOWLEDGEMENTS ^

COPYRIGHT & LICENCE ^

Copyright 2009 Brad Macpherson.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public Licence as published by the Free Software Foundation; or the Artistic Licence.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: