Rather than just switch directories and launch Domino, this script also checks the current user and checks to see if the server is already running.
#!/bin/bash
NOTES_USER=notes # Notes user id
NOTES_PATH=/home/notes # Home directory of Notes userid
NOTES_DATA=/local/notesdata/ # Domino data directory
NOTES_SERVER=/opt/lotus/ # Domino server location
SERVER_NAME=BDTEST3 # Domino server name
OUTPUT_LOG=/var/log/$SERVER_NAME.log # Where we will put the log
PATH=$NOTES_PATH:/opt/lotus/bin:$HOME/bin:$PATH
if [ `whoami` != notes ];
then
echo "Don't use root for running Domino server "
su - notes
fi
if [ ! -x $NOTES_SERVER/bin/server ] ; then
echo "Cannot found the server command - exiting"
exit 1
fi
if [ ! -d $NOTES_DATA ] ;
then
echo "Cannot access notes data directory - exiting"
exit 1
fi
NOTES_RUNNING=`ps -fu notes | awk '{print $8}' | grep /opt/lotus | \
grep -v grep | cut -d"/" -f 1,2,3,4 | head -n1`
if ! $NOTES_RUNNING ;
then
echo "Domino Server is already running - exiting"
exit 1
fi
cd $NOTES_DATA
rm -f ~notes.lck
mems=`ipcs -m | grep $NOTES_USER | awk '{ print $2 }'`
sems=`ipcs -s | grep $NOTES_USER | awk '{ print $2 }'`
for j in $mems; do if [ -n "$j" ];then ipcrm shm $j > tmp.lck;fi; done
for j in $sems; do if [ -n "$j" ];then ipcrm sem $j > tmp.lck;fi; done
rm -f tmp.lck
echo "Running Domino for LINUX"
/opt/lotus/bin/server > $OUTPUT_LOG 2>&1 &
previous page
|