Help with adding new service to SMF

From: Brent (mrb@bmyster.com)
Date: Tue Jun 20 2006 - 15:01:14 EDT


Im trying to add a new service (lets use suns mysql for an example) I have
been following the howto from

http://mediacast.sun.com/share/bobn/SMF-migrate.pdf

and

http://blogs.sun.com/roller/page/bobn?entry=manifests_for_apache1_and_mysql

I installed suns mysql onto the new Solaris 10 box started it to make sure it
worked then shut it down & then proceded to create the below manifest script
by following the howto at the above URLs. Pretty much what i did was copy the
/var/svc/manifest/system/zones.xml to /var/svc/manifest/site/mysql.xml then made
the changes per the howto . Below is the actual script. Then ran the
/lib/svc/method/manifest_import

and i get

bash-3.00# /lib/svc/method/manifest-import
WARNING: svccfg import /var/svc/manifest/site/mysql.xml failed
Loaded 1 smf(5) service descriptions
svccfg warnings:
svccfg: couldn't parse document
bash-3.00#

I go and look at the /var/svc/log/system-manifest-import\:default.log
for some clue to what might be going on and there is nothing in there from the
date that i ran the command.

Ive tried this on 2 different solaris 10 boxes and the same thing happens
which makes me think that something is wrong with the script i wrote or edited.

Can anyone please shed some light on this ??? what is it that im doing wrong
here ???? I need to know how to add a new service to SMF ...please ??

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
    Copyright 2004 Sun Microsystems, Inc. All rights reserved.
    Use is subject to license terms.

    ident "@(#)zones.xml 1.2 04/12/09 SMI"

    NOTE: This service manifest is not editable; its contents will
    be overwritten by package or patch operations, including
    operating system upgrade. Make customizations in a different
    file.
-->

<service_bundle type='manifest' name='MySQL'>

<service
        name='application/mysql'
        type='service'
        version='1'>

        <create_default_instance enabled='true' />

        <single_instance />

        <dependency name='multi-user-server' type='service'
grouping='require_all' restart_on='none'>
                <service_fmri value='svc:/milestone/multi-user-server' />
        </dependency>

        <dependency name='filesystem' grouping=require_all' restart_on='none'
type='service'>
                <service_fmri value='svc:/system/filesystem/local' />
        </dependency>

        <dependency name='database_configuration' type='path'
grouping='require_all' restart_on='refresh'>
                <service_fmri value='file://localhost/var/mysql/my.cnf'/>
        </dependency>

        <exec_method
                type='method'
                name='start'
                exec='/etc/sfw/mysql/mysql.server %m'
                timeout_seconds='60'>
        </exec_method>

        <exec_method
                type='method'
                name='stop'
                exec='/etc/sfw/mysql/mysql.server %m'
                timeout_seconds='120'>
        </exec_method>

        <exec_method
                type='method'
                name='restart'
                exec='/etc/sfw/mysql/mysql.server %m'
                timeout_seconds='120'>
        </exec_method>

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

        <stability value='Unstable' />

        <template>
                <common_name>
                        <loctext xml:lang='C'>
                        MySQL Database
                        </loctext>
                </common_name>
                <documentation>
                        <manpage title='mysql' section='1'
manpath='/usr/sfw/man' />
                        <manpage title='mysqld'
section='1'manpath='/usr/sfw/man' />
                        <manpage title='mysqladmin' section='1'
manpath='/usr/sfw/man' />
                </documentation>
        </template>
</service>

</service_bundle>

--
Brent 
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:40:11 EDT