#! /bin/sh command=$1 datadir=$2 force=$3 MWWATCHDOG_TERMINATION_FILE=$datadir/watchdog.keepalive case "$command" in 'start') if [ "$MWOS" = "aix" ]; then MALLOCMULTIHEAP=true export MALLOCMULTIHEAP elif [ "$MWOS" = "sunos5" ]; then LD_LIBRARY_PATH=/usr/lib/lwp:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH elif [ "$MWOS" = "ux11" ]; then _M_ARENA_OPTS=64:2 export _M_ARENA_OPTS fi cd $HOME mwpingreg if [ $? -eq 0 ]; then echo "MainWin System Core Services are already running." exit 0 fi # start the watchdog that makes sure there are always a registry # server and a rpcss running. watchdog $MWWATCHDOG_TERMINATION_FILE status=$? if [ $status -eq 0 ]; then echo "MainWin System Core Services version `mwadm version` started." fi exit $status ;; 'stop') mwpingreg if [ $? -ne 0 ]; then echo "Core Services are not running." exit 0 fi if [ "$force" != "-f" ]; then wc=wc if [ -x /bin/wc ]; then wc=/bin/wc elif [ -x /usr/bin/wc ]; then wc=/usr/bin/wc fi count=`regps | $wc -l` if [ $count -gt 1 ]; then # predefined exit code. exit 2 fi fi /bin/rm -f $MWWATCHDOG_TERMINATION_FILE regshutdown > /dev/null 2>&1 echo "MainWin System Core Services stopped." ;; *) echo "Usage $0 { start | stop [-f] }" exit 100 ;; esac