#! /bin/sh # # /etc/init.d/bongo # ### BEGIN INIT INFO # Provides: bongo # Required-Start: $network $remote_fs # Required-Stop: $remote_fs # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: Start and stops Bongo # Description: Bongo collaboration system, for info visit: http://www.bongo-project.com ### END INIT INFO # Source SuSE config PATH=/sbin:/bin:/usr/sbin:/usr/bin . /etc/rc.status if [ -f /etc/sysconfig/bongo ]; then . /etc/sysconfig/bongo else OPTIONS= fi BONGO_DIR=@CMAKE_INSTALL_PREFIX@ BONGO_BIN=@CMAKE_INSTALL_PREFIX@/sbin BONGO_NAME=bongo-manager BONGO_CONFIG=bongo-config BONGO_LIST="bongoantisapm bongoavirus bongo-config bongoimap bongo-manager bongopop3 bongoqueue bongo-queuetool bongorules bongosmtp bongosmtpc bongostore bongo-testtool" BONGO_DATA=@CMAKE_INSTALL_PREFIX@/var/bongo/dbf/userdb.sqlite echo $BONGO_BIN/$BONGO_NAME test -x $BONGO_BIN/$BONGO_NAME || exit 5 # Shell functions sourced from /etc/rc.status: # rc_check check and set local and overall rc status # rc_status check and set local and overall rc status # rc_status -v ditto but be verbose in local rc status # rc_status -v -r ditto and clear the local rc status # rc_failed set local and overall rc status to failed # rc_reset clear local rc status (overall remains) # rc_exit exit appropriate to overall rc status # First reset status of this service rc_reset # Return values acc. to LSB for all commands but status: # 0 - success # 1 - misc error # 2 - invalid or excess args # 3 - unimplemented feature (e.g. reload) # 4 - insufficient privilege # 5 - program not installed # 6 - program not configured # # Note that starting an already running service, stopping # or restarting a not-running service as well as the restart # with force-reload (in case signalling is not supported) are # considered a success. case "$1" in start) if [ ! -r $BONGO_DATA ] ; then HOSTNAME=`/bin/hostname` echo "Initializing bongo: @DATA_INSTALL_DIR@" $BONGO_BIN/$BONGO_CONFIG --smtp=2525 --domain=$HOSTNAME 2>&1 fi echo -n "Starting Bongo Daemon:" startproc $BONGO_BIN/$BONGO_NAME $OPTIONS 2>&1 # Remember status and be verbose rc_status -v ;; stop) echo -n "Shutting down Bongo Daemon" killproc -TERM -t 60 $BONGO_BIN/$BONGO_NAME 2>&1 # Remember status and be verbose rc_status -v ;; reload|restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start # Remember status and be quiet rc_status ;; status) echo -n "Checking for Bongo Daemon: " checkproc $BONGO_NAME rc_status -v ;; *) echo "Usage: $0 {start|stop|status|restart|reload}" exit 1 ;; esac rc_exit