Solaris 10 start - stop script

For what its worth, Wildfire 3.1.0 beta 2 w/ the Registration Plugin beta runs great on Solaris 10 Sparc.

I made some very simple changes to the generic init script so that it works in Solaris 10:


#!/usr/bin/bash

  1. wildfired

  1. chkconfig: 2345 20 80

  2. description: Used to start and stop the wildfire XMPP server

  3. Script used to start wildfire as daemon

  4. The script has currently been tested on Redhat Fedora Core 3,

  5. but should theoretically work on most UNIX like systems

  1. before running this script make sure $WILDFIRE_HOME/bin/wildfire is

  2. executable by the user you want to run wildfire as

  3. (chmod +x $WILDFIRE_HOME/bin/wildfire)

  1. This script should be copied into /etc/init.d and linked into

  2. your default runlevel directory.

  3. You can find your default runlevel directory by typing:

  4. grep default /etc/inittab

  1. Link to the directory like follows

  2. cd /etc/rc.d

  3. ln -s …/init.d/wildfired $90wildfired

  1. Set this to tell this script where wildfire lives

  2. If this is not set the script will look for /opt/wildfire, then /usr/local/wildfire

export WILDFIRE_HOME=/usr/local/wildfire

  1. If there is a different user you would like to run this script as,

  2. change the following line

export WILDFIRE_USER=jive


  1. If a wildfire home variable has not been specified, try to determine it

if ; then

if [ -d “/opt/wildfire” ]; then

WILDFIRE_HOME="/opt/wildfire"

elif [ -d “/usr/local/wildfire” ]; then

WILDFIRE_HOME="/usr/local/wildfire"

else

echo “Could not find Wildfire installation under /opt or /usr/local”

echo “Please specify the Wildfire installation location in environment variable WILDFIRE_HOME”

exit 1

fi

fi

function execCommand() {

OLD_PWD=pwd

cd $WILDFIRE_HOME/bin

CMD="./wildfire $1"

su $WILDFIRE_USER $CMD &

cd $OLD_PWD

}

start() {

execCommand “start”

}

stop() {

execCommand “stop”

}

case “$1” in

start)

start

;;

stop)

stop

;;

*)

echo “Usage $0 {start|stop}”

exit 1

esac

exit 0