Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML troubles adding a SMF service

Status
Not open for further replies.

ToMaC82

Technical User
Jan 23, 2008
83
US
I'm trying to add a new service through SMF but I'm getting an error while trying to add it via svccfg. As far as I can tell, everything looks good. Can someone help guide me in the right direction?

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">

<service_bundle type='manifest' name='routproc'>
<service
name='system/routproc'
type='service'
version='1'>

<single_instance />

<exec_method
type='method'
name='start'
exec='/lib/svc/manifest/svc-routproc'
timeout_seconds='60' />

<exec_method
type='method'
name='stop'
exec=':kill'
timeout_seconds='60' />

<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='child' />
</property_group>

<!-- Wait for network interfaces to be initialized. -->
<dependency name="network" grouping="require_all" restart_on="none" type="service">
<service_fmri value="svc:/milestone/network:default"/>
</dependency>
<!-- Wait for all local filesystems to be mounted. -->
<dependency name="filesystem-local" grouping="require_all" restart_on="none" type="service">
<service_fmri value="svc:/system/filesystem/local:default"/>
</dependency>

<instance name='default' enabled='false'>
<method_context>
<method_credential user='micro' group='mmaker' />
</method_context>
</instance>

<stability value='Unstable' />

<create_default_instance enabled='false' />

<template>
<common_name>
<loctext xml:lang='C'>
routproc service for MileMaker
</loctext>
</common_name>
</template>
</service>
</service_bundle>



Returns,
# svccfg import /var/svc/manifest/system/routproc.xml
/var/svc/manifest/system/routproc.xml:8: element service: validity error : Element service content does not follow the DTD, expecting (create_default_instance? , single_instance? , restarter? , dependency* , dependent* , method_context? , exec_method* , property_group* , instance* , stability? , template?), got (single_instance exec_method exec_method property_group dependency dependency instance stability create_default_instance template )
svccfg: Document is not valid.

Thanks!
 
You asked:
Can someone help guide me in the right direction?

I believe the clue to solving the problem is in the error message. It is saying it is expecting a certain order of XML 'keywords' and telling you the order you specified.
There are lots of XML 'scripts' in /var/svc/manifest/system which can serve as very good examples.

It may also help to use the command:
svccfg validate /var/svc/manifest/system/routproc.xml
before:
svccfg -v import /var/svc/manifest/system/routproc.xml

I hope that helps.

Mike
 
That helped a lot, I didn't know that it mattered what order the keywords were in. Thanks Mike!
 
Good Day,

The dtd is supposedly available at /usr/share/lib/xml/dtd/service_bundle.dtd.1

It describes the expected XML document.

Regards,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top