壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 796|回复: 0

[Domino C/S开发] Domino脚本问题请高手指教!谢谢谢谢! 急急急!在线等!

[复制链接]
发表于 2004/6/8 08:42:47 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
我写的Domino脚本如下
但是在SERVER shutdown时,Domino server却不能正常停止Domino server (启动时已经运行了/etc/rc0.d/k99notes stop)不知道是什么原因!请高手指教一下,小弟在这里先谢了!!(我的系统是:Sun Solaris 8 Japanese.)谢谢谢谢谢谢!
        

STARTDOMINO.SH

#!/bin/sh
# Description
# start Domino server
#  2004/05 Hitachi Software
######################

if [ ! "$1" ] || [ ! "$2" ]
then
        echo "Usage: startdomino.sh NOTES_USER NOTES_SERVER"
        exit 1
fi
##### Environment #####
##### Notes #####
NOTES_USER=$1
NOTES_SERVER=$2
NOTES_PATH=/opt/lotus/bin

##### Shell #####
SHELL_PATH=/notesshell
IO_PATH=$SHELL_PATH/$NOTES_SERVER

##### Input/Output #####
#INPUT=$IO_PATH/input.file

##### Time Format(yymmdd@hhmmss) #####
TIME=`date +"%y%m%d@%H%M%S"`

##### Notes data directory
case "$NOTES_USER" in
'fjflm102')
        NOTES_BASE=/notes1/fjflm102
        ;
'fjflm103')
        NOTES_BASE=/notes2/fjflm103
        ;
'fjflm104')
        NOTES_BASE=/notes/fjflm104
        ;
*)
        echo "Notes user not exist"
        exit 1
        ;
esac
NOTES_DATA=$NOTES_BASE/data
##### Log directory #####
LOG_PATH=$NOTES_BASE/log
EVENT_LOG=$LOG_PATH/event.log
OUTPUT_LOG=$LOG_PATH/domino.log
##### LOG_PATH Exist?
if [ ! -d $LOG_PATH ]
then
        mkdir $LOG_PATH
fi
#outlog copy
test -f $OUTPUT_LOG && cp $OUTPUT_LOG ${LOG_PATH}/old_${TIME}domino.log
#Eventlog copy
#cp $EVENT_LOG ${LOG_PATH}/old_event.log

##### Initialize redirection files
#rm -f $INPUT
#touch $INPUT
rm -f $OUTPUT_LOG
echo "" > $OUTPUT_LOG

##### user check (NOTES_USER?)
if [ `/usr/xpg4/bin/id -u` -ne `/usr/xpg4/bin/id -u ${NOTES_USER}` ]
then
    echo "error: can't execute. change Domino User (${NOTES_USER})\n"
    exit
fi

##### Domino server Execute?
NOTES_RUNNING=`ps -fu $NOTES_USER | grep /65010/ | grep -v grep`
if [ -n "$NOTES_RUNNING" ]  then
    echo "error: Domino Server(${NOTES_SERVER}) is Running\n"
    exit 1
fi

##### Cleaning Enviroment - ~notes.lck, shared mem, .NOTESMEM* (for ABORT)
rm -f ~notes.lck
mems=`ipcs | grep $NOTES_USER | awk '{ print $1 $2 }' | awk -F"m"  '{ print $2 }'
| awk '{ print $1 }'`
sems=`ipcs | grep $NOTES_USER | awk '{ print $1 $2 }' | awk -F"s"  '{ print $2 }'
| awk '{ print $1 }'`
for j in $mems;do if [ -n "$j" ]  then ipcrm -m $j;fi;done
for j in $sems;do if [ -n "$j" ]  then ipcrm -s $j;fi;done
for i in ` ls -al /tmp | grep NOTESMEM | awk '/ '$NOTES_USER' / {print $9}'`
   do
     echo "removing mmap file " $i
     rm -f /tmp/$i
   done

# enable this if server is password-protected.(<- not USED.)
#cat $IO_PATH/domino_pass_$NOTES_SERVER > $INPUT
# logging event
echo "$TIME  Starting Domino Server" >> $EVENT_LOG

# start Domino server
#cd $NOTES_DATA  ${NOTES_PATH}/server < $INPUT |${SHELL_PATH}/log.sh $OUTPUT_LOG&
1> /dev/null 2>&1 &
cd $NOTES_DATA  ${NOTES_PATH}/server |${SHELL_PATH}/log.sh $OUTPUT_LOG& 1> /dev/n
ull 2>&1 &






NOTESSRV.SH

#!/bin/sh
# Description
# start/stop Domino server
#  2005/05 Hitachi Software
######################

SHELL_PATH=/notesshell
NOTES_USER=fjflm104
NOTES_SERVER=fjflm104
STARTSH=$SHELL_PATH/startdomino.sh
STOPSH=$SHELL_PATH/stopdomino.sh

case "$1" in
&#39;start&#39;)
        if [ -x $STARTSH ]; then
                echo "Starting Domino..."
                /usr/bin/su - $NOTES_USER -c "$STARTSH $NOTES_USER $NOTES_SERVER"
        else
                echo "Cannot start Domino."
        fi
        ;
&#39;stop&#39;)
        if [ -x $STOPSH ]; then
                echo "Stopping Domino..."
                /usr/bin/su - $NOTES_USER -c "$STOPSH $NOTES_USER $NOTES_SERVER"
        else
                echo "Cannot stop Domino."
fi
        ;
*)
        echo "Usage: /notesshell/notessrv.sh { start|stop }"
        ;
esac
exit 0





STOPDOMINO.SH

#!/bin/sh
# Description
# shutdown Domino server
#  2004/05 Hitachi Software
################

if [ ! "$1" ] || [ ! "$2" ]
then
        echo "Usage: stopdomino.sh NOTES_USER NOTES_SERVER"
        exit 1
fi

##### Environment #####
##### Notes #####
NOTES_USER=$1
NOTES_SERVER=$2
NOTES_PATH=/opt/lotus/bin

##### Configuration Parameter #####
DELAY=600       # Notes Shutdown Delay (X second)
INTERVAL=10     # Shutdown Check Interval in Delay (X second)

##### Time Format(yymmdd@hhmmss) #####
TIME=`date +"%y%m%d@%H%M%S"`

##### Notes data directory
case "$NOTES_USER" in
&#39;fjflm102&#39;)
        NOTES_BASE=/notes1/fjflm102
        
&#39;fjflm103&#39;)
        NOTES_BASE=/notes2/fjflm103
        
&#39;fjflm104&#39;)
        NOTES_BASE=/notes/fjflm104
        
*)
        echo "Notes user not exist"
        exit 1
        
esac
NOTES_DATA=$NOTES_BASE/data
##### Log directory #####
LOG_PATH=$NOTES_BASE/log
EVENT_LOG=$LOG_PATH/event.log
OUTPUT_LOG=$LOG_PATH/domino.log

##### Shutdown Notes Server #####
cd $NOTES_DATA
${NOTES_PATH}/server -q 1> /dev/null 2>&1 &

##### if Domino server doesn&#39;t shutdown properly, kill manually
echo "wait\c"
STOP_NORMAL=1
COUNT=${INTERVAL}
while [ $COUNT -lt $DELAY ]  do
   pid=`ps -f -u ${NOTES_USER} | grep /65010/ | grep -v grep | nawk &#39;{print $2}&#39;`
   if [ ! "${pid}" ]  then
      STOP_NORMAL=0
      break
   fi
   sleep $INTERVAL
   echo ".\c"
   COUNT=`expr ${COUNT} + ${INTERVAL}`
done
echo ""
rm -f ~notes.lck
grep1="grep $NOTES_USER"
for i in `ps -ef | $grep1 | awk &#39; /65010/ && ! /awk/ {print $2}&#39;`
        do
                echo "Killing notes process "$i
                kill -9 $i

done
        for i in ` ipcs | $grep1 | awk &#39;/^m / {print $2}&#39;`
        do
          echo "removing Shared Memory " $i
          ipcrm -m $i
        done
        for i in ` ipcs | $grep1 | awk &#39;/^s / {print $2}&#39;`
        do
          echo "removing Semaphore " $i
          ipcrm -s $i
        done
        for i in ` ipcs | $grep1 | awk &#39;/^s / {print $1}&#39;`
        do
          echo "removing Semaphore " $i
          set n = `echo $i | cut -c2-`
          ipcrm -s $n
        done
        for i in `ls -al /tmp | grep NOTESMEM | awk &#39;/ &#39;$NOTES_USER&#39; / {print $9}&#39;
`
        do
          echo "removing mmap " $i
          rm -f /tmp/$i
        done
        echo "Domino Server shutdown completed."
# write to event log
SHUTDOWN_TIME=`date +"%y%m%d@%H%M%S"`
echo "$SHUTDOWN_TIME  Domino server shutdown completed" >> $EVENT_LOG

##### Shutdown Check #####
if [ $STOP_NORMAL = 0 ]; then
        exit 0
else
        exit 1
fi

/等待/等待
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/30 07:41 , Processed in 0.011813 second(s), 16 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表