[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Linux-cluster] CommuniGate as service?



I am trying to setup CommuniGate
(http://www.stalker.com/content/default.html) as a cluster service.  I have
everything working except for one thing.  If I stop/kill the process
manually and wait for the status check to move the service nothing happens.


I get "clurgmgrd: [3087]: <info> Executing /etc/init.d/CommuniGate status"
rather than the "clurgmgrd: [3087]: <err> script:httpd-webcal: status of
/etc/init.d/httpd-webcal failed (returned 3)" I get with an apache process.

I had to add the "status" part to /etc/init.d/CommuniGate file myself, but
there is obviously a problem.  I have mucked around with it for a while but
I am just putting it out there if my mistakes are obvious.  

# If you have placed the application folder in a different directory,
#    change the APPLICATION variable
#
# The default location for the CommuniGate Pro "base directory" (a folder
# containing mail accounts, settings, logs, etc.) is /var/CommuniGate
# If you want to use a different location, change the BASEFOLDER variable
#
#
APPLICATION="/opt"
BASEFOLDER="/var/CommuniGate"
SUPPLPARAMS=
PROG="/opt/CommuniGate/CGServer"
#ADDED
pidfile=${PIDFILE-/var/run/CommuniGate.pid}
lockfile=${LOCKFILE-/var/lock/subsys/CommuniGate}
RETVAL=0
#/ADDED
[ -f ${APPLICATION}/CommuniGate/CGServer ] || exit 0

# Some Linux distributions come with the "NPTL" threads library
# that crashes quite often. The following lines are believed to force
# Linux to use the old working threads library.
#
#LD_ASSUME_KERNEL=2.4.1
#export LD_ASSUME_KERNEL

# Source function library.
if [ -f /etc/rc.d/init.d/functions ]; then
  . /etc/rc.d/init.d/functions
elif [ -f /etc/init.d/functions ]; then
  . /etc/init.d/functions
fi

ulimit -u 2000
ulimit -c 2097151
umask 0

# Custom startup parameters
if [ -f ${BASEFOLDER}/Startup.sh ]; then
  . ${BASEFOLDER}/Startup.sh
fi

case "$1" in
  start)
    if [ -d ${BASEFOLDER} ] ; then
      echo
    else
      echo "Creating the CommuniGate Base Folder..."
      mkdir ${BASEFOLDER}
      chgrp mail ${BASEFOLDER}
      chmod 2770 ${BASEFOLDER}
    fi
    echo -n "Starting CommuniGate Pro"
    ${APPLICATION}/CommuniGate/CGServer \
        --Base ${BASEFOLDER} --Daemon ${SUPPLPARAMS} \
#       --ClusterBackend
#       --ClusterFrontend
    #Comment out
    #touch /var/lock/subsys/CommuniGate
    #ADD
    touch ${pidfile}
    RETVAL=$?
    echo
    [ "$RETVAL = 0" ] && touch ${lockfile}
    #return $RETVAL
    #/ADDED
    ;;
  controller)
    echo "Starting CommuniGate Pro Cluster Controller"
    ${APPLICATION}/CommuniGate/CGServer \
        --Base ${BASEFOLDER} --Daemon ${SUPPLPARAMS} \
        --ClusterController
    touch /var/lock/subsys/CommuniGate
    ;;
  stop)
     if [ -f ${BASEFOLDER}/ProcessID ]; then
       echo "Shutting down the CommuniGate Pro Server"
       kill `cat ${BASEFOLDER}/ProcessID`
       sleep 5
     else
       echo "It looks like the CommuniGate Pro Server is not running"
     fi
     #eric
     rm -f ${pidfile}
     ##Orig
     #rm -f /var/lock/subsys/CommuniGate
     #ADDED
     RETVAL=$?
     echo
     [ "$RETVAL = 3" ] && rm -f ${lockfile} #${pidfile}
     #/ADDED
     ;;
     #ADDED
  status)
     status $PROG
     RETVAL=$?
     ;;
     #/ADDED
  *)
     echo "Usage: $0 [ start | stop | status ]"
     exit 1
esac

exit 0





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]