[Date Prev]   [Date Next] [Thread Prev]   [Thread Next] [Date Index]   [Thread Index]

 

     Re: trouble with keep_alive script

> > > I've gotten nocol set up and I have the individual monitors running just > fine. When I try and use the keep_alive script I get this: > > longterm 38 % ./keepalive_monitors > ./keepalive_monitors: test: argument expected > > I've checked all of the variables in keepalive_monitors and I can't find > anything obviously wrong. > > This is on a Sun SparcServer 1000 > running Solaris 2.6 > > Any thoughts from folks? > > Colin E. Johnson | colinj@unm.edu | http://www.unm.edu/~colinj/ > ". . .so I simply point to where I keep the soul I have, right by the > exit, just next to the blues." --Nick Hornby _High_Fidelity_ > I also had this problem, but think I solved this problem by modifying the following blocks. -------Original block from distribution ---------------- if [ -f ${PIDDIR}/${p}.pid ]; then PID=`head -1 ${PIDDIR}/${p}.pid` else PID="" fi if [ -z $PID ]; then pgmname=`basename $p`; ps ${PSFLAGS} 2>&1 |grep -v grep |egrep "$pgmname( |\$)" >/dev/null 2>&1 #ps ${PSFLAGS} |grep -v grep |egrep "${BIN}/${p}([ ]*|\$)" >/dev/null 2>&1 else ps ${PSNUMFLAGS} $PID | grep ${p} >/dev/null 2>&1 fi ---------------end of Original block ------------------- ----------- Modified block ------------------------------ if [ -f ${PIDDIR}/${p}.pid ]; then PID=`head -1 ${PIDDIR}/${p}.pid` else PID="0" fi if [ $PID = "0" ]; then pgmname=`basename $p`; ps ${PSFLAGS} 2>&1 |grep -v grep |egrep "$pgmname( |\$)" >/dev/null 2>&1 #ps ${PSFLAGS} |grep -v grep |egrep "${BIN}/${p}([ ]*|\$)" >/dev/null 2>&1 else ps ${PSNUMFLAGS} $PID | grep ${p} >/dev/null 2>&1 fi -----------end of Modified block Please note that the change is done on how the PID variable is assigned an initial value if the process id is not found and how the PID variable is checked. Regards, Babu Koshy