#!/bin/sh # # Startup script for OpenGroupware on UNIX systems. # # Based on Henrik Holmboe script # Changed for RedHat 9 By Yedidia Klein # # NOTE: This script currently needs to have an environment that # automatically sources ~/OpenGroupware.org.sh. This is achievable with # this command: (as opengroupware user) # # echo "source /opt/opengroupware.org/OpenGroupware.org.sh" >> ~/.bash_profile # # NOTE2: Redhat 9 users has also to set LD_ASSUME_KERNEL This is achievable with # this command: (as opengroupware user) # echo "export LD_ASSUME_KERNEL=2.4.1" >> ~/.bash_profile # # Marius Andreiana suggested to change the chkconfig numbers for starting OGo After postgressql (thanks Marius) # # chkconfig: 2345 99 10 # description: OpenGroupware is a groupware server # Configuration section OGO_DIR=/opt/opengroupware.org OGO_BIN=$OGO_DIR/WOApps/OpenGroupware.woa/ix86/linux-gnu/gnu-fd-nil/OpenGroupware OGO_ARGS="-WOPort 20000 -WOHttpAllowHost localhost.localdomain -OGoMinimumActiveSessionCount 0" PID_FILE=/var/run/ogo.pid LOG=/var/log/ogo.log # end configuration section # Source function library. # Use the funtions provided by Red Hat or use our own if [ -f /etc/rc.d/init.d/functions ] then . /etc/rc.d/init.d/functions else function action { echo "$1" shift $@ } function success { echo -n "Success" } function failure { echo -n "Failed" } fi [ -x $OGO_BIN ] || exit 0 case "$1" in start) echo -n "Starting OpenGroupware: " pushd $OGO_DIR > /dev/null # log separator echo "----------------------------------------------------------------------" >> $LOG # run as a user 'opengroupware': if [ "`uname -s`" = "Linux" ]; then env -i su - opengroupware -c "$OGO_BIN $OGO_ARGS" >> $LOG 2>&1 & elif [ "`uname -s`" = "FreeBSD" ]; then env -i su -l opengroupware -c "$OGO_BIN $OGO_ARGS" >> $LOG 2>&1 & fi echo $! > $PID_FILE popd > /dev/null success "Starting OpenGroupware" echo ;; stop) echo -n "Shutting down OpenGroupware: " if test -f "$PID_FILE" ; then PID=`cat $PID_FILE` if kill $PID >> $LOG 2>&1 ; then /bin/rm $PID_FILE success "Shutting down OpenGroupware" else echo "" echo "Could not kill process $PID named in $PID_FILE. Check tail of $LOG." failure "Shutting down OpenGroupware" fi else echo "" echo "No OpenGroupware pid file found. Looked for $PID_FILE." failure "No OpenGroupware pid file found. Looked for $PID_FILE." fi echo ;; restart) $0 stop $0 start ;; *) echo "Usage: opengroupware {start|stop|restart}" exit 1 esac exit 0