155 lines
3.7 KiB
XML
155 lines
3.7 KiB
XML
<?xml version="1.0"?>
|
|
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
|
|
<!--
|
|
#
|
|
# Copyright 2016-2017 Jim Klimov
|
|
# Service for the upsd daemon (and drivers, if available)
|
|
#
|
|
-->
|
|
|
|
<service_bundle type='manifest' name='nut-server'>
|
|
|
|
<service name='system/power/nut-server' type='service' version='1'>
|
|
|
|
<!--
|
|
Configure a default instance for the service since it doesn't
|
|
require additional configuration intervention before it starts.
|
|
-->
|
|
<create_default_instance enabled='false' />
|
|
|
|
<!--
|
|
Wait for all local and usr filesystem to be mounted - project is
|
|
usually located in /usr/sbin.
|
|
-->
|
|
<dependency
|
|
name='fs-local'
|
|
type='service'
|
|
grouping='require_all'
|
|
restart_on='none'>
|
|
<service_fmri value='svc:/system/filesystem/local' />
|
|
</dependency>
|
|
|
|
<dependency
|
|
name='filesystem-usr'
|
|
grouping='require_all'
|
|
restart_on='none'
|
|
type='service'>
|
|
<service_fmri
|
|
value='svc:/system/filesystem/usr:default'/>
|
|
</dependency>
|
|
|
|
<dependency
|
|
name='config-files'
|
|
type='path'
|
|
grouping='require_all'
|
|
restart_on='refresh'>
|
|
<service_fmri value='file://localhost@CONFPATH@/ups.conf' />
|
|
<service_fmri value='file://localhost@CONFPATH@/upsd.conf' />
|
|
<service_fmri value='file://localhost@CONFPATH@/upsd.users' />
|
|
</dependency>
|
|
|
|
<!--
|
|
Wait for syslog to be started in order to write system
|
|
messages from the kernel.
|
|
-->
|
|
<dependency
|
|
name='syslog'
|
|
grouping='optional_all'
|
|
restart_on='none'
|
|
type='service'>
|
|
<service_fmri
|
|
value='svc:/system/system-log:default'/>
|
|
</dependency>
|
|
|
|
<!--
|
|
Wait for network to be started in order to reach remote hosts.
|
|
-->
|
|
<dependency
|
|
name='network-service'
|
|
grouping='optional_all'
|
|
restart_on='none'
|
|
type='service'>
|
|
<service_fmri value='svc:/network/service' />
|
|
</dependency>
|
|
|
|
<!--
|
|
Wait for drivers to be wrapped in service instances
|
|
Note that drivers are optional: if one fails to start or get configured,
|
|
do not block the upsd from publishing others.
|
|
-->
|
|
<dependency
|
|
name='nut-driver-enumerator'
|
|
grouping='optional_all'
|
|
restart_on='none'
|
|
type='service'>
|
|
<service_fmri value='svc:/system/power/nut-driver-enumerator' />
|
|
</dependency>
|
|
|
|
<!--
|
|
Prerequisite for NUT upsmon to be started, if it's enabled
|
|
Although that may (also) be a client to some other server...
|
|
-->
|
|
<dependent
|
|
name='nut-monitor-service'
|
|
grouping='optional_all'
|
|
restart_on='none'>
|
|
<service_fmri value='svc:/system/power/nut-monitor' />
|
|
</dependent>
|
|
|
|
<!--
|
|
The nut start/stop methods.
|
|
-->
|
|
|
|
<exec_method
|
|
type='method'
|
|
name='start'
|
|
exec='@NUT_DATADIR@/solaris-smf/method/svc-nut-server %m'
|
|
timeout_seconds='60'/>
|
|
|
|
<exec_method
|
|
type='method'
|
|
name='refresh'
|
|
exec='@NUT_DATADIR@/solaris-smf/method/svc-nut-server %m'
|
|
timeout_seconds='60'/>
|
|
|
|
<exec_method
|
|
type='method'
|
|
name='stop'
|
|
exec=':kill'
|
|
timeout_seconds='60' />
|
|
|
|
<property_group name='startd' type='framework'>
|
|
<!--
|
|
Sub-process core dumps and external kill signals are not
|
|
considered errors, so the service should be restarted.
|
|
-->
|
|
<propval name='ignore_error' type='astring'
|
|
value='core,signal' />
|
|
</property_group>
|
|
|
|
<!-- Really unstable - this service should be evolved! -->
|
|
<stability value='Unstable' />
|
|
|
|
<template>
|
|
<common_name>
|
|
<loctext xml:lang='C'>
|
|
NUT data server
|
|
</loctext>
|
|
</common_name>
|
|
<documentation>
|
|
<manpage title='upsdrvctl' section='8'
|
|
manpath='/usr/share/man' />
|
|
<manpage title='upsd' section='8'
|
|
manpath='/usr/share/man' />
|
|
<manpage title='ups.conf' section='5'
|
|
manpath='/usr/share/man' />
|
|
<manpage title='upsd.conf' section='5'
|
|
manpath='/usr/share/man' />
|
|
<manpage title='upsd.users' section='5'
|
|
manpath='/usr/share/man' />
|
|
</documentation>
|
|
</template>
|
|
</service>
|
|
|
|
</service_bundle>
|