Here is one that does not run xindice as root. The prerequisite is that
the proper environment is set up in a profile for the XINDICE_USER that
owns the database instance.

Anders

------------------------------------------------------------------------
#!/bin/sh
#
# Start og stop af Xindice XML-database
#
# Baseret p� dbXML/start scriptet
#
# AC 21.12.2001

#
# load the configuration
#
. /etc/rc.config
. /etc/rc.status   

#
# The echo return value for success (defined in /etc/rc.config).
#
return=$rc_done

XINDICE_USER=xindice

if test -z "$XINDICE_HOME"; then
   XINDICE_HOME=/opt/xindice
   export XINDICE_HOME
fi

PID_FILE=$XINDICE_HOME/config/xindice.pid

case $1 in 

start)
        echo -n "Starting Xindice"

        # Check for leftover pid-file after crash
        # NB Only allowed in system startup procedure!
        if [ -f "$PID_FILE" ]
        then 
                rm $PID_FILE
        fi

        su - $XINDICE_USER -c "./start &" || return=$rc_failed

        echo $return
;;

stop)
        echo -n "Shutting down Xindice"
        su - $XINDICE_USER -c "xindiceadmin shutdown -c /db" ||
return=$rc_failed 
        echo $return
;;

restart)
        $0 stop  && sleep 3 &&  $0 start  ||  return=$rc_failed
        echo $return
;;

esac

------------------------------------------------------------------


Anders Conrad
Redakt�r, cand.mag.
Det Danske Sprog- og Litteraturselskab
E-mail: [EMAIL PROTECTED]
Tlf. (+45) 33 13 84 20 - 9626


-----Oprindelig meddelelse-----
Fra: Fernando Padilla [mailto:[EMAIL PROTECTED] 
Sendt: 23. maj 2002 18:52
Til: [email protected]
Emne: etc/rc.d/init.d script



Hello.

Has anyone out there created a script that can be used for the init.d 
system?

fernando

Reply via email to