xref: /titanic_44/usr/src/cmd/svc/dtd/service_bundle.dtd.1 (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
4 Use is subject to license terms.
5
6 CDDL HEADER START
7
8 The contents of this file are subject to the terms of the
9 Common Development and Distribution License, Version 1.0 only
10 (the "License").  You may not use this file except in compliance
11 with the License.
12
13 You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14 or http://www.opensolaris.org/os/licensing.
15 See the License for the specific language governing permissions
16 and limitations under the License.
17
18 When distributing Covered Code, include this CDDL HEADER in each
19 file and include the License file at usr/src/OPENSOLARIS.LICENSE.
20 If applicable, add the following below this CDDL HEADER, with the
21 fields enclosed by brackets "[]" replaced with your own identifying
22 information: Portions Copyright [yyyy] [name of copyright owner]
23
24 CDDL HEADER END
25
26    ident	"%Z%%M%	%I%	%E% SMI"
27-->
28
29<!--
30  Service description DTD
31
32    Most attributes are string values (or an individual string from a
33    restricted set), but attributes with a specific type requirement are
34    noted in the comment describing the element.
35-->
36
37<!--
38  XInclude support
39
40    A series of service bundles may be composed via the xi:include tag.
41    smf(5) tools enforce that all bundles be of the same type.
42-->
43<!ELEMENT xi:include
44  (xi:fallback)
45  >
46<!ATTLIST xi:include
47  href CDATA #REQUIRED
48  parse (xml|text) "xml"
49  encoding CDATA #IMPLIED
50  xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude"
51  >
52
53<!ELEMENT xi:fallback
54  ANY
55  >
56<!ATTLIST xi:fallback
57  xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude"
58  >
59
60<!--
61  stability
62
63    This element associates an SMI stability level with the parent
64    element.  See attributes(5) for an explanation of interface
65    stability levels.
66
67    Its attribute is
68
69	value	The stability level of the parent element.
70-->
71
72<!ELEMENT stability EMPTY>
73
74<!ATTLIST stability
75	value		( Standard | Stable | Evolving | Unstable |
76			External | Obsolete ) #REQUIRED >
77
78<!-- Property value lists -->
79
80<!--
81  value_node
82
83    This element represents a single value within any of the typed
84    property value lists.
85
86    Its attribute is
87
88	value	The value for this node in the list.
89-->
90
91<!ELEMENT value_node EMPTY>
92
93<!ATTLIST value_node
94	value CDATA #REQUIRED>
95
96<!--
97  count_list
98  integer_list
99  opaque_list
100  host_list
101  hostname_list
102  net_address_v4_list
103  net_address_v6_list
104  time_list
105  astring_list
106  ustring_list
107  boolean_list
108  fmri_list
109  uri_list
110
111    These elements represent the typed lists of values for a property.
112    Each contains one or more value_node elements representing each
113    value on the list.
114
115    None of these elements has attributes.
116-->
117
118<!ELEMENT count_list
119	( value_node+ )>
120
121<!ATTLIST count_list>
122
123<!ELEMENT integer_list
124	( value_node+ )>
125
126<!ATTLIST integer_list>
127
128<!ELEMENT opaque_list
129	( value_node+ )>
130
131<!ATTLIST opaque_list>
132
133<!ELEMENT host_list
134	( value_node+ )>
135
136<!ATTLIST host_list>
137
138<!ELEMENT hostname_list
139	( value_node+ )>
140
141<!ATTLIST hostname_list>
142
143<!ELEMENT net_address_v4_list
144	( value_node+ )>
145
146<!ATTLIST net_address_v4_list>
147
148<!ELEMENT net_address_v6_list
149	( value_node+ )>
150
151<!ATTLIST net_address_v6_list>
152
153<!ELEMENT time_list
154	( value_node+ )>
155
156<!ATTLIST time_list>
157
158<!ELEMENT astring_list
159	( value_node+ )>
160
161<!ATTLIST astring_list>
162
163<!ELEMENT ustring_list
164	( value_node+ )>
165
166<!ATTLIST ustring_list>
167
168<!ELEMENT boolean_list
169	( value_node+ )>
170
171<!ATTLIST boolean_list>
172
173<!ELEMENT fmri_list
174	( value_node+ )>
175
176<!ATTLIST fmri_list>
177
178<!ELEMENT uri_list
179	( value_node+ )>
180
181<!ATTLIST uri_list>
182
183<!-- Properties and property groups -->
184
185<!--
186   property
187
188     This element is for a singly or multiply valued property within a
189     property group.  It contains an appropriate value list element,
190     which is expected to be consistent with the type attribute.
191
192     Its attributes are
193
194	name	The name of this property.
195
196	type	The data type for this property.
197
198	override These values should replace values already in the
199		repository.
200-->
201
202<!ELEMENT property
203	( count_list | integer_list | opaque_list | host_list | hostname_list |
204	net_address_v4_list | net_address_v6_list | time_list |
205	astring_list | ustring_list | boolean_list | fmri_list |
206	uri_list )? >
207
208<!ATTLIST property
209	name		CDATA #REQUIRED
210	type		( count | integer | opaque | host | hostname |
211			net_address_v4 | net_address_v6 | time |
212			astring | ustring | boolean | fmri | uri ) #REQUIRED
213	override	( true | false ) "false" >
214
215<!--
216   propval
217
218     This element is for a singly valued property within a property
219     group.  List-valued properties must use the property element above.
220
221     Its attributes are
222
223	name	The name of this property.
224
225	type	The data type for this property.
226
227	value	The value for this property.  Must match type
228		restriction of type attribute.
229
230	override This value should replace any values already in the
231		repository.
232-->
233
234<!ELEMENT propval EMPTY>
235
236<!ATTLIST propval
237	name		CDATA #REQUIRED
238	type		( count | integer | opaque | host | hostname |
239			net_address_v4 | net_address_v6 | time | astring |
240			ustring | boolean | fmri | uri ) #REQUIRED
241	value		CDATA #REQUIRED
242	override	( true | false ) "false" >
243
244<!--
245  property_group
246
247    This element is for a set of related properties on a service or
248    instance.  It contains an optional stability element, as well as
249    zero or more property-containing elements.
250
251    Its attributes are
252
253	name	The name of this property group.
254
255	type	A category for this property group.  Groups of type
256		"framework", "implementation" or "template" are primarily
257		of interest to the service management facility, while
258		groups of type "application" are expected to be only of
259		interest to the service to which this group is attached.
260		Other types may be introduced using the service symbol
261		namespace conventions.
262
263	delete	If in the repository, this property group should be removed.
264-->
265
266<!ELEMENT property_group
267	( stability?, ( propval | property )* )>
268
269<!ATTLIST property_group
270	name		CDATA #REQUIRED
271	type		CDATA #REQUIRED
272	delete		( true | false ) "false" >
273
274<!--
275  service_fmri
276
277    This element defines a reference to a service FMRI (for either a
278    service or an instance).
279
280    Its attribute is
281
282	value	The FMRI.
283-->
284
285<!ELEMENT service_fmri EMPTY>
286
287<!ATTLIST service_fmri
288	value		CDATA #REQUIRED>
289
290<!-- Dependencies -->
291
292<!--
293  dependency
294
295    This element identifies a group of FMRIs upon which the service is
296    in some sense dependent.  Its interpretation is left to the
297    restarter to which a particular service instance is delegated.  It
298    contains a group of service FMRIs, as well as a block of properties.
299
300    Its attributes are
301
302	name	The name of this dependency.
303
304	grouping The relationship between the various FMRIs grouped
305		here; "require_all" of the FMRIs to be online, "require_any"
306		of the FMRIs to be online, or "exclude_all" of the FMRIs
307		from being online for the dependency to be satisfied.
308		"optional_all" dependencies are satisfied when all
309		of the FMRIs are either online or unable to come
310		online (because they are disabled, misconfigured, or one
311		of their dependencies is unable to come online).
312
313	restart_on The type of events from the FMRIs that the service should
314		be restarted for.  "error" restarts the service if the
315		dependency is restarted due to hardware fault.  "restart"
316		restarts the service if the dependency is restarted for
317		any reason, including hardware fault.  "refresh" restarts
318		the service if the dependency is refreshed or restarted for
319		any reason.  "none" will never restart the service due to
320		dependency state changes.
321
322	type	The type of dependency: on another service ('service'), on
323		a filesystem path ('path'), or another dependency type.
324
325	delete	This dependency should be deleted.
326-->
327
328<!ELEMENT dependency
329	( service_fmri*, stability?, ( propval | property )* ) >
330
331<!ATTLIST dependency
332	name		CDATA #REQUIRED
333	grouping	( require_all | require_any | exclude_all |
334			optional_all ) #REQUIRED
335	restart_on	( error | restart | refresh | none ) #REQUIRED
336	type		CDATA #REQUIRED
337	delete		( true | false ) "false" >
338
339<!-- Dependents -->
340
341<!--
342  dependent
343
344    This element identifies a service which should depend on this service.  It
345    corresponds to a dependency in the named service.  The grouping and type
346    attributes of that dependency are implied to be "require_all" and
347    "service", respectively.
348
349    Its attributes are
350
351	name	The name of the dependency property group to create in the
352		dependent entity.
353
354	grouping The grouping relationship of the dependency property
355		group to create in the dependent entity.  See "grouping"
356		attribute on the dependency element.
357
358	restart_on The type of events from this service that the named service
359		should be restarted for.
360
361	delete	True if this dependent should be deleted.
362
363	override Whether to replace an existing dependent of the same name.
364
365-->
366
367<!ELEMENT dependent
368	( service_fmri, stability?, ( propval | property )* ) >
369
370<!ATTLIST dependent
371	name		CDATA #REQUIRED
372	grouping	( require_all | require_any | exclude_all |
373			optional_all) #REQUIRED
374	restart_on	( error | restart | refresh | none) #REQUIRED
375	delete		( true | false ) "false"
376	override	( true | false ) "false" >
377
378<!-- Method execution context, security profile, and credential definitions -->
379
380<!--
381  envvar
382
383    An environment variable. It has two attributes:
384
385	name	The name of the environment variable.
386	value	The value of the environment variable.
387-->
388
389<!ELEMENT envvar EMPTY>
390
391<!ATTLIST envvar
392	name		CDATA #REQUIRED
393	value		CDATA #REQUIRED >
394
395<!--
396  method_environment
397
398    This element defines the environment for a method. It has no
399    attributes, and one or more envvar child elements.
400-->
401
402<!ELEMENT method_environment (envvar+) >
403
404<!ATTLIST method_environment>
405
406<!--
407  method_profile
408
409    This element indicates which exec_attr(5) profile applies to the
410    method context being defined.
411
412    Its attribute is
413
414	name	The name of the profile.
415-->
416
417<!ELEMENT method_profile EMPTY>
418
419<!ATTLIST method_profile
420	name		CDATA #REQUIRED >
421
422<!--
423  method_credential
424
425    This element specifies credential attributes for the execution
426    method to use.
427
428    Its attributes are
429
430	user	The user ID, in numeric or text form.
431
432	group	The group ID, in numeric or text form.  If absent or
433		":default", the group associated with the user in the
434		passwd database.
435
436	supp_groups Supplementary group IDs to be associated with the
437		method, separated by commas or spaces.  If absent or
438		":default", initgroups(3C) will be used.
439
440	privileges An optional string specifying the privilege set.
441
442	limit_privileges An optional string specifying the limit
443		privilege set.
444-->
445
446<!ELEMENT method_credential EMPTY>
447
448<!ATTLIST method_credential
449	user		CDATA #REQUIRED
450	group		CDATA ":default"
451	supp_groups	CDATA ":default"
452	privileges	CDATA ":default"
453	limit_privileges CDATA ":default" >
454
455<!--
456  method_context
457
458    This element combines credential and resource management attributes
459    for execution methods.  It may contain a method_environment, or
460    a method_profile or method_credential element.
461
462    Its attributes are
463
464	working_directory The home directory to launch the method from.
465		":default" can be used as a token to indicate use of the
466		user specified by the credential or profile specified.
467
468	project	The project ID, in numeric or text form.  ":default" can
469		be used as a token to indicate use of the project
470		identified by getdefaultproj(3PROJECT) for the non-root
471		user specified by the credential or profile specified.
472		If the user is root, ":default" designates the project
473		the restarter is running in.
474
475	resource_pool The resource pool name to launch the method on.
476		":default" can be used as a token to indicate use of the
477		pool specified in the project(4) entry given in the
478		"project" attribute above.
479-->
480<!ELEMENT method_context
481	( (method_profile | method_credential)?, method_environment? ) >
482
483<!ATTLIST method_context
484	working_directory	CDATA ":default"
485	project			CDATA ":default"
486	resource_pool		CDATA ":default" >
487
488<!-- Restarter delegation, methods, and monitors -->
489
490<!--
491  exec_method
492
493    This element describes one of the methods used by the designated
494    restarter to act on the service instance.  Its interpretation is
495    left to the restarter to which a particular service instance is
496    delegated.  It contains a set of attributes, an optional method
497    context, and an optional stability element for the optional
498    properties that can be included.
499
500    Its attributes are
501
502	type	The type of method, either "method" or "monitor".
503
504	name	Name of this execution method.  The method names are
505		usually a defined interface of the restarter to which an
506		instance of this service is delegated.
507
508	exec	The string identifying the action to take.  For
509		svc.startd(1M), this is a string suitable to pass to
510		exec(2).
511
512	timeout_seconds [integer] Duration, in seconds, to wait for this
513		method to complete.  A '0' or '-1' denotes an infinite
514		timeout.
515
516	delete	If in the repository, the property group for this method
517		should be removed.
518-->
519
520<!ELEMENT exec_method
521	( method_context?, stability?, ( propval | property )* ) >
522
523<!ATTLIST exec_method
524	type		( method | monitor ) #REQUIRED
525	name		CDATA #REQUIRED
526	exec		CDATA #REQUIRED
527	timeout_seconds	CDATA #REQUIRED
528	delete		( true | false ) "false" >
529
530<!--
531  restarter
532
533    A flag element identifying the restarter to which this service or
534    service instance is delegated.  Contains the FMRI naming the
535    delegated restarter.
536
537    This element has no attributes.
538-->
539
540<!ELEMENT restarter
541	( service_fmri ) >
542
543<!ATTLIST restarter>
544
545<!--
546  Templates
547-->
548
549<!--
550  doc_link
551
552    The doc_link relates a resource described by the given URI to the
553    service described by the containing template.  The resource is
554    expected to be a documentation or elucidatory reference of some
555    kind.
556
557    Its attributes are
558
559      name      A label for this resource.
560
561      uri       A URI to the resource.
562-->
563
564<!ELEMENT doc_link EMPTY>
565
566<!ATTLIST doc_link
567	name		CDATA #REQUIRED
568	uri		CDATA #REQUIRED >
569
570<!--
571  manpage
572
573    The manpage element connects the reference manual page to the
574    template's service.
575
576    Its attributes are
577
578      title     The manual page title.
579
580      section   The manual page's section.
581
582      manpath   The MANPATH environment variable, as described in man(1)
583                that is required to reach the named manual page
584-->
585
586<!ELEMENT manpage EMPTY>
587
588<!ATTLIST manpage
589	title		CDATA #REQUIRED
590	section		CDATA #REQUIRED
591	manpath		CDATA ":default" >
592
593<!--
594  documentation
595
596    The documentation element groups an arbitrary number of doc_link
597    and manpage references.
598
599    It has no attributes.
600-->
601
602<!ELEMENT documentation
603	( doc_link | manpage )* >
604
605<!ATTLIST documentation>
606
607<!--
608  loctext
609
610    The loctext element is a container for localized text.
611
612    Its sole attribute is
613
614	xml:lang The name of the locale, in the form accepted by LC_ALL,
615		etc.  See locale(5).
616-->
617<!ELEMENT loctext
618        (#PCDATA) >
619
620<!ATTLIST loctext
621        xml:lang	CDATA #REQUIRED >
622
623<!--
624  description
625
626    The description holds a set of potentially longer, localized strings that
627    consist of a short description of the serive.
628
629    The description has no attributes.
630-->
631<!ELEMENT description
632        ( loctext+ ) >
633
634<!ATTLIST common_name>
635
636<!--
637  common_name
638
639    The common_name holds a set of short, localized strings that
640    represent a well-known name for the service in the given locale.
641
642    The common_name has no attributes.
643-->
644<!ELEMENT common_name
645        ( loctext+ ) >
646
647<!ATTLIST common_name>
648
649<!--
650  template
651
652    The template contains a collection of metadata about the service.
653    It contains a localizable string that serves as a common,
654    human-readable name for the service.  (This name should be less than
655    60 characters in a single byte locale.)  The template may optionally
656    contain a longer localizable description of the service, a
657    collection of links to documentation, either in the form of manual
658    pages or in the form of URI specifications to external documentation
659    sources (such as docs.sun.com).
660
661    The template has no attributes.
662-->
663<!ELEMENT template
664        ( common_name, description?, documentation?) >
665
666<!ATTLIST template>
667
668<!-- Services and instances -->
669
670<!--
671  create_default_instance
672
673    A flag element indicating that an otherwise empty default instance
674    of this service (named "default") should be created at install, with
675    its enabled property set as given.
676
677    Its attribute is
678
679	enabled	[boolean] The initial value for the enabled state of
680		this instance.
681-->
682
683<!ELEMENT create_default_instance EMPTY >
684
685<!ATTLIST create_default_instance
686	enabled		( true | false ) #REQUIRED >
687
688<!--
689  single_instance
690
691    A flag element stating that this service can only have a single
692    instance on a particular system.
693-->
694
695<!ELEMENT single_instance EMPTY>
696
697<!ATTLIST single_instance>
698
699<!--
700  instance
701
702    The service instance is the object representing a software component
703    that will run on the system if enabled.  It contains an enabled
704    element, a set of dependencies on other services, potentially
705    customized methods or configuration data, an optional method
706    context, and a pointer to its restarter.  (If no restarter is
707    specified, the master restarter, svc.startd(1M), is assumed to be
708    responsible for the service.)
709
710    Its attributes are
711
712	name	The canonical name for this instance of the service.
713
714	enabled	[boolean] The initial value for the enabled state of
715		this instance.
716-->
717
718<!ELEMENT instance
719	( restarter?, dependency*, dependent*, method_context?,
720	exec_method*, property_group*, template? ) >
721
722<!ATTLIST instance
723	name		CDATA #REQUIRED
724	enabled		( true | false ) #REQUIRED >
725
726<!--
727  service
728
729    The service contains the set of instances defined by default for
730    this service, an optional method execution context, any default
731    methods, the template, and various restrictions or advice applicable
732    at installation.  The method execution context and template elements
733    are required for service_bundle documents with type "manifest", but
734    are optional for "profile" or "archive" documents.
735
736    Its attributes are
737
738	name	The canonical name for the service.
739
740	version	[integer] The integer version for this service.
741
742	type	Whether this service is a simple service, a delegated
743		restarter, or a milestone (a synthetic service that
744		collects a group of dependencies).
745-->
746
747<!ELEMENT service
748	( create_default_instance?, single_instance?, restarter?,
749	dependency*, dependent*, method_context?, exec_method*,
750	property_group*, instance*, stability?, template? ) >
751
752<!ATTLIST service
753	name		CDATA #REQUIRED
754	version		CDATA #REQUIRED
755	type		( service | restarter | milestone ) #REQUIRED >
756
757<!--
758  service_bundle
759
760    The bundle possesses two attributes:
761
762	type	How this file is to be understood by the framework (or
763		used in a non-framework compliant way). Standard types
764		are 'archive', 'manifest', and 'profile'.
765
766	name	A name for the bundle.  Manifests should be named after
767		the package which delivered them; profiles should be
768		named after the "feature set nickname" they intend to
769		enable.
770-->
771
772<!ELEMENT service_bundle
773	( service_bundle* | service* | xi:include* )>
774
775<!ATTLIST service_bundle
776	type		CDATA #REQUIRED
777	name		CDATA #REQUIRED>
778