Hello,

I'm fairly new to the whole Solaris SMF and I created the following manifest to 
handle Informix:

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
        Manifesto para la ejecucion del manejador de base de datos Informix
        Copyright 2007 Ing. Dami?n Finol 

-->

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

<service
        name='network/informix'
        type='service'
        version='1'>

        <!--

        -->

        <instance name='informix' enabled='false'>
                <dependency name='loopback'
                    grouping='require_all'
                    restart_on='error'
                    type='service'>
                        <service_fmri value='svc:/network/loopback:default'/>
                </dependency>

                <dependency name='physical'
                    grouping='optional_all'
                    restart_on='error'
                    type='service'>
                        <service_fmri value='svc:/network/physical:default'/>
                </dependency>

                <exec_method
                        type='method'
                        name='start'
                        exec='/lib/svc/method/informix start'
                        timeout_seconds='60' />

                <exec_method
                        type='method'
                        name='stop'
                        exec='/lib/svc/method/informix stop'
                        timeout_seconds='60' />

                <exec_method
                        type='method'
                        name='refresh'
                        exec='/lib/svc/method/informix restart'
                        timeout_seconds='60' />

        </instance>


</service>

</service_bundle>

informix method is this:

#!/bin/sh
#
#   This script is to be used to startup and shutdown the Informix Server
#   Optimized for HP/UX
#
#   Installation instructions 
#
#   Copy this script to /sbin/init.d 
#   Link it to a start and a stop file in each of the rc?.d directory
#   appropriate for the run level for which you wish the engine to be started, 
eg:
#   
#   $ ln -s /sbin/init.d/informix /sbin/rc3.d/S900informix
#   $ ln -s /sbin/init.d/informix /sbin/rc2.d/K020informix
#
####################################################################################
#
# Note: You can set the Informix environment several ways.
#   You can hardcode it here - or else you can set it using a file.
#   If you hardcode it here, it would look something like this...
#
#export INFORMIXDIR=/opt/informix
#export INFORMIXSERVER=myserver_shm
#export ONCONFIG=onconfig.myserver

# If you  set it using a file, it might look like this...


#-------------------------------------------------------------------------------------

if [ $# -lt 1 ]
then
    echo "Usage: $0 {start|stop|start_msg|stop_msg}"
else
 case "$1" in 
 
 "start_msg") echo "Starting up the Informix Online Server..." ;;
 
 "stop_msg") echo "Shutting down the Informix Online Server..." ;;
 
 "start")
     if [ `$INFORMIXDIR/bin/onstat 2>&- | /usr/bin/grep -c "not initialized"` 
-ne 0 ]
     then
     
         # If you wanted to rotate the online.log at start-up time
         # this would be a good place to put it.
         # /home/informix/bin/rotate_informix_logs.sh

         echo "Starting up the Informix Online Engine... "

         $INFORMIXDIR/bin/oninit
         
         cnt=60             # Give informix 60 seconds to come online before 
giving up
         flag_online=false 
         while [ $cnt -gt 0 ]
         do
             if [ `$INFORMIXDIR/bin/onstat 2>&- | /usr/bin/grep -c "not 
initialized"` -eq 0 ]
             then
                flag_online=true
                break
             fi
             cnt=`expr $cnt - 1`        # Decrement cnt
             sleep 1
         done

         if [ $flag_online = true ]
         then
             $INFORMIXDIR/bin/onstat -
             # If you wanted to start continuous logging to tape at start-up 
time
             # this would be a good place to put it.
             # /home/informix/bin/start_logging.sh &

             echo "Zero profile counts..."
             onstat -z
             echo "done"
         else
             echo "Warning: the Informix Online Engine did NOT start 
successfully!"
         fi
     fi
     ;;

 "stop")
     if [ `$INFORMIXDIR/bin/onstat 2>&- | /usr/bin/grep -c "not initialized"` 
-eq 0 ]
     then
         # If you wanted to stop continuous logging to tape at shutdown time
         # this would be a good place to put it.
         # /home/informix/bin/stop_logging.sh
         
         echo "Shutting down the Informix Online Engine... "
         $INFORMIXDIR/bin/onmode -ky

         cnt=60             # Give informix 60 seconds to come offline before 
giving up
         flag_online=true
         while [ $cnt -gt 0 ]
         do
             if [ `$INFORMIXDIR/bin/onstat 2>&- | /usr/bin/grep -c "not 
initialized"` -ne 0 ]
             then
                flag_online=false
                break
             fi
             cnt=`expr $cnt - 1`        # Decrement cnt
         sleep 1
         done

         if [ $flag_online = true ]
         then
             echo "Warning: the Informix Online Engine did NOT go offline 
successfully!"
         else
             echo "done"
         fi
     fi
     ;;
 "restart")
     if [ `$INFORMIXDIR/bin/onstat 2>&- | /usr/bin/grep -c "not initialized"` 
-eq 0 ]
     then
         # If you wanted to stop continuous logging to tape at shutdown time
         # this would be a good place to put it.
         # /home/informix/bin/stop_logging.sh
         
         echo "Shutting down the Informix Online Engine... "
         $INFORMIXDIR/bin/onmode -ky

         cnt=60             # Give informix 60 seconds to come offline before 
giving up
         flag_online=true
         while [ $cnt -gt 0 ]
         do
             if [ `$INFORMIXDIR/bin/onstat 2>&- | /usr/bin/grep -c "not 
initialized"` -ne 0 ]
             then
                flag_online=false
                break
             fi
             cnt=`expr $cnt - 1`        # Decrement cnt
         sleep 1
         done

         if [ $flag_online = true ]
         then
             echo "Warning: the Informix Online Engine did NOT go offline 
successfully!"
         else
             echo "done"
         fi
     fi
     if [ `$INFORMIXDIR/bin/onstat 2>&- | /usr/bin/grep -c "not initialized"` 
-ne 0 ]
     then
     
         # If you wanted to rotate the online.log at start-up time
         # this would be a good place to put it.
         # /home/informix/bin/rotate_informix_logs.sh

         echo "Starting up the Informix Online Engine... "

         $INFORMIXDIR/bin/oninit
         
         cnt=60             # Give informix 60 seconds to come online before 
giving up
         flag_online=false 
         while [ $cnt -gt 0 ]
         do
             if [ `$INFORMIXDIR/bin/onstat 2>&- | /usr/bin/grep -c "not 
initialized"` -eq 0 ]
             then
                flag_online=true
                break
             fi
             cnt=`expr $cnt - 1`        # Decrement cnt
             sleep 1
         done

         if [ $flag_online = true ]
         then
             $INFORMIXDIR/bin/onstat -
             # If you wanted to start continuous logging to tape at start-up 
time
             # this would be a good place to put it.
             # /home/informix/bin/start_logging.sh &

             echo "Zero profile counts..."
             onstat -z
             echo "done"
         else
             echo "Warning: the Informix Online Engine did NOT start 
successfully!"
         fi
     fi
     ;;
 *)
     echo "Usage: $0 {start|stop|start_msg|reload|stop_msg}"
     ;;
 esac
fi


Now, it works perfectly, I just need to run this as the user 'informix'

I tried doing it like the tutorial for apache2 says, to svccfg then set prop 
start/user=astring: informix but I keep getting that the property start doesn't 
exists.

Can someone give me a hand with this please? I'll appreciate it :)


Thank you
 
 
This message posted from opensolaris.org

Reply via email to