User Tools

Site Tools


redhat:script_to_start_and_stop_a_domino_server

Script to start and stop a Domino server

#!/bin/bash
#
# /etc/init.d/domino
#
### BEGIN INIT INFO
# Provides:          Domino
# Required-Start:    $syslog $remote_fs $network
# Required-Stop:     $syslog $remote_fs $network
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Domino providing IBM Lotus Domino Server
# Description:       Start Domino to provide an IBM Lotus Domino Server
### END INIT INFO
# 

. /etc/init.d/functions
DATADIR=/local/notesdata
RETVAL=0
ulimit -n 20000 

start() {
	echo -n "Starting Domino Server"
	sudo -u notes /opt/ibm/lotus/bin/server "=$DATADIR/notes.ini" &
	RETVAL=$?

	# Remember status and be verbose
	echo
	[ $RETVAL -eq 0 ]
	return $RETVAL
}

stop() {
	echo -n "Shutting down Domino Server"
	sudo -u notes /opt/ibm/lotus/bin/server "=$DATADIR/notes.ini" -q
	RETVAL=$?

	# Remember status and be verbose
	RETVAL=0   # have to force this since since there's no way of really
                        # knowing
	echo
	[ $RETVAL -eq 0 ]
	return $RETVAL
}

restart() {
	# Stop the service and regardless of whether it was running or not,
        # start it again.
	stop
	start
}

case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    restart)
	restart
	;;
    *)
 echo "Usage: $0 {start|stop|restart}"
 exit 1
 ;;
esac
exit $RETVAL

Place the file above to the directory “/etc/init.d” e.g. as the file “domino”.

Make this file executable:

chmod +x /etc/init.d/domino

To automatically start and stop a server if Linux is atrting and stopping you need to run the following commands:

cd /etc/rc0.d
ln -s /etc/init.d/domino K10domino

cd /etc/rc2.d
ln -s /etc/init.d/domino S99domino

cd /etc/rc3.d
ln -s /etc/init.d/domino S99domino 
redhat/script_to_start_and_stop_a_domino_server.txt · Last modified: 2014/10/12 00:39 by 127.0.0.1