Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Configuring SVCS  for my script

Posted on 2013-06-24
4
611 Views
Last Modified: 2013-07-12
I am trying setup a svcs and i am getting svccfg: couldn't parse document when i tried to validate my xml document. Please advise on how to fix this. I am new to svcs.

root@:/var/svc/manifest/site> ls -l /lib/svc/method/myscript
-rwxr-xr-x   1 root     root         544 Jun 24 14:00 /lib/svc/method/myscript
root@:/var/svc/manifest/site> cat /lib/svc/method/myscript
#!/bin/bash
#
# creating and removing file during startup
#
#
#
# See how we were called.


case $1 in
        start)
            echo "myfile has been created"
            touch  /tmp/myfile
            ;;
        restart)
            echo "your script stopping"
            rm /tmp/myfile
            echo "your script starting"
        touch /tmp/myfile
            ;;
        status)
            echo "your script running"
            ;;
        stop)
            echo "your script stopping"
            rm /tmp/myfile
            ;;
esac



root@:/var/svc/manifest/site> svccfg validate /var/svc/manifest/site/myservice.xml
svccfg: couldn't parse document
root@:/var/svc/manifest/site> cat /var/svc/manifest/site/myservice.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM
    /usr/share/lib/xml/dtd/service_bundle.dtd.1">

<service_bundle type="manifest" name="manoservice">
  <service name="site/manoservice" type="service" version="1">
    <create_default_instance enabled="false" />

    <!-- Dependencies -->
    <dependency
        name="filesystem-local" grouping="require_all"
        restart_on="restart" type="service">
        <service_fmri value="svc:/system/filesystem/local:default" />
    </dependency>

    <!-- Execution method for start and stop -->
    <exec_method
         type="method" name="start"
         exec="/lib/svc/method/myscript" timeout_seconds="60" >
      <method_context>
          <method_credential user="root" group="root" />
      </method_context>
    </exec_method>

    <exec_method
       type="method" name="stop" exec=":kill -9"
       timeout_seconds="60" >
    </exec_method>

    <template>
       <common_name>
         <loctext xml:lang="C">My example service</loctext>
       </common_name>
       <documentation>
          <manpage title="No man" section="99" manpath="/dev/null" />
       </documentation>
    </template>
  </service>
</service_bundle>
0
Comment
Question by:ittechlab
  • 2
4 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39274695
>><!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1">

Missing a double quote in this line.

To find errors, open the xml file in any xml validator.  For the error above, I just used Internet Explorer.
0
 

Author Comment

by:ittechlab
ID: 39275835
Thanks. after i fixed the double quote, I am not getting any error. From here I am not sure how to proceed. Please advise.

root@:/root> svccfg validate /var/svc/manifest/site/myservice.xml
root@:/root>
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 250 total points
ID: 39275848
I don't know.  Never used it before.

I was just responding to the original question:  "tried to validate my xml document. Please advise on how to fix this.".

I did see there was a svccfg apply option but I have no way to know if that is the next step or not.

I would check the docs on setting up services for the next step.
0
 
LVL 1

Accepted Solution

by:
Ponmaniraja earned 250 total points
ID: 39277424
Hi,

Just you have to import the script in the svccfg utility, Usebelow

svccfg import /var/svc/manifest/site/myservice.xml

Follow by svcadm refresh and restart commands.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Character matching different date formats for dates between 6 59
Nimble Storage 3 104
dbms_crypto.decrypt   errors out 6 33
oracle collections 2 20
In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question