File: nut-server.xml.in

package info (click to toggle)
nut 2.8.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,356 kB
  • sloc: ansic: 123,904; sh: 14,718; cpp: 12,558; makefile: 5,212; python: 1,114; perl: 855; xml: 47
file content (163 lines) | stat: -rw-r--r-- 4,780 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
#
# Copyright 2016-2024 Jim Klimov
# Service for the upsd daemon (note: drivers, if available, are
# wrapped by service instances managed by nut-driver-enumerator)
#
-->

<service_bundle type='manifest' name='nut-server'>

	<service name='system/power/nut-server' type='service' version='3'>

	<!--
	  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>

		<!-- Also used by nut-driver.xml to stay in sync regarding the rights -->
		<property_group name='nut' type='application'>
			<stability value='Evolving' />
			<propval name='NUT_RUN_DIR' type='astring' value='@ALTPIDPATH@' />
			<propval name='NUTUSER' type='astring' value='@RUN_AS_USER@' />
			<propval name='NUTGROUP' type='astring' value='@RUN_AS_GROUP@' />
		</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>
				<doc_link name='upsd online'		uri='@NUT_WEBSITE_BASE@/docs/man/upsd.html' />
				<manpage title='upsd'			section='@MAN_SECTION_CMD_SYS@' manpath='@NUT_MANDIR@' />
				<doc_link name='ups.conf online'	uri='@NUT_WEBSITE_BASE@/docs/man/ups.conf.html' />
				<manpage title='ups.conf'		section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
				<doc_link name='upsd.conf online'	uri='@NUT_WEBSITE_BASE@/docs/man/upsd.conf.html' />
				<manpage title='upsd.conf'		section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
				<doc_link name='upsd.users online'	uri='@NUT_WEBSITE_BASE@/docs/man/upsd.users.html' />
				<manpage title='upsd.users'		section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
				<doc_link name='nut.conf online'	uri='@NUT_WEBSITE_BASE@/docs/man/nut.conf.html' />
				<manpage title='nut.conf'		section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
			</documentation>
		</template>
	</service>

</service_bundle>