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