From: Nelson Kawumi <kawumin@mtn.co.ug>
Subject: help
Date: Wed, 31 Jul 2002 16:46:02 +0300 [thread overview]
Message-ID: <3329C67DF372FD429F610AF04ACDC538FA5B4E@ugamailudb.mtn.co.ug> (raw)
>I'm running a script that does continuous ftp of files to a given ftp
>server. When started manually, it runs fine. When started using CAA, it
>gives the following error,
>
>
>
>EVM alert [sauga01.mtn.co.ug]: CAAD[524900]: `streamserve` on `sauga01` went
>OFFLINE unexpectedly
>
>in the CAA script I run the following to stop the application
>
>kill `ps -e | grep streamserve.sh | grep -v "grep" | cut -d " " -f 1`
>
>I need help on this error
>
>Attached are my profile and script
>
>Profile
>
>NAME=streamserve
>
>TYPE=application
>
>ACTION_SCRIPT=streamserve.scr
>
>ACTIVE_PLACEMENT=0
>
>AUTO_START=1
>
>CHECK_INTERVAL=60
>
>DESCRIPTION=streamserve
>
>FAILOVER_DELAY=0
>
>FAILURE_INTERVAL=40
>
>FAILURE_THRESHOLD=3
>
>HOSTING_MEMBERS=sauga02 sauga01
>
>OPTIONAL_RESOURCES=
>
>PLACEMENT=restricted
>
>REQUIRED_RESOURCES=
>
>RESTART_ATTEMPTS=1
>
>SCRIPT_TIMEOUT=60
>
>Script
>
>
>
>SERVICE_NAME="streamserve"
>
>PROBE_PROCS="/usr/scripts/streamserve.sh"
>
>START_APPCMD="/usr/scripts/streamserve.sh"
>
>STOP_APPCMD="/usr/scripts/streamservestop.sh"
>
>APPDIR="/usr/scripts"
>
>export SERVICE_NAME START_APPCMD START_APPCMD2
>
>export APPDIR PROBE_PROCS STOP_APPCMD STOP_APPCMD2
>
>DEBUG_PRIORITY=100
>
>INFO_PRIORITY=200
>
>ERROR_PRIORITY=500
>
>SCRIPT=$0
>
>ACTION=$1 # Action (start, stop or check)
>
>EVMPOST="/usr/bin/evmpost" # EVM command to post events
>
>DEBUG=0
>
>if [[ "$CAA_SCRIPT_DEBUG" != "" ]]; then
>
>DEBUG=1
>
>EVMPOST="/usr/bin/evmpost -r | /usr/bin/evmshow -d"
>
>fi
>
>export EVMPOST ACTION SCRIPT
>
>etpid () {
>
>if [ -n "$1" ]; then
>
>GETMYPID=$1
>
>shift
>
>/bin/ps -e -o pid,command $* | while read mypid command args
>
>do
>
>if [ "$command" = "$GETMYPID" ]; then
>
>echo "$mypid"
>
>fi
>
>done
>
>fi
>
>
>
>zapdaemon () {
>
>typeset ret=0
>
>for i in ${1}
>
>do
>
>checkdaemon ${i}
>
>if [ $? -ne 0 ]; then
>
>kill `getpid ${i}`
>
>checkdaemon ${i}
>
>if [ $? -ne 0 ]; then
>
>kill -9 `getpid ${i}`
>
>checkdaemon ${i}
>
>if [ $? -ne 0 ]; then
>
>postevent $ERROR_PRIORITY "${i}: stuck - could not kill -KIL
>
>L"
>
>ret=1
>
>else
>
>postevent $ERROR_PRIORITY "${i}: killed with -KILL"
>
>fi
>
>else
>
>postevent "" "${i}: killed"
>
>fi
>
>fi
>
>done
>
>return $ret
>
>
>
>probeapp () {
>
>checkdaemon $1
>
>if [ $? -ne 0 ]; then
>
>postevent $DEBUG_PRIORITY "$1 check OK"
>
>return 0
>
>else
>
>postevent $DEBUG_PRIORITY "$1 check failed"
>
>return 1
>
>fi
>
>
>
>case $1 in
>
>'start')
>
>postevent $DEBUG_PRIORITY "trying to start"
>
>cd $APPDIR
>
>if [ "$START_APPCMD" != "" ]; then
>
>$START_APPCMD &
>
>if [ $? -ne 0 ]; then
>
>postevent $ERROR_PRIORITY "start: $out"
>
>exit 1
>
>fi
>
>fi
>
>
>
>'stop')
>
>postevent $DEBUG_PRIORITY "trying to stop"
>
>cd $APPDIR
>
>if [ "$STOP_APPCMD" != "" ]; then
>
>$STOP_APPCMD &
>
>if [ $? -ne 0 ]; then
>
>postevent $ERROR_PRIORITY "stop: $out"
>
>exit 1
>
>fi
>
>fi
>
>if [ $STOP_APPCMD2 != "" ]; then
>
>$STOP_APPCMD2 &
>
>if [ $? -ne 0 ]; then
>
>postevent $ERROR_PRIORITY "stop 2: $out"
>
>exit 1
>
>fi
>
>fi
>
>if [ "$START_APPCMD2" != "" ]; then
>
>$START_APPCMD2 &
>
>if [ $? -ne 0 ]; then
>
>postevent $ERROR_PRIORITY "start 2: $out"
>
>exit 1
>
>fi
>
>fi
>
>;;
>
>for i in ${PROBE_PROCS}; do
>
>zapdaemon ${i}
>
>done
>
>;;
>
>'check')
>
>for i in ${PROBE_PROCS}; do
>
>postevent $DEBUG_PRIORITY "trying to check $i"
>
>probeapp $i
>
>if [ $? -ne 0 ]; then
>
>postevent "" "check failed for $i"
>
>exit 1
>
>fi
>
>done
>
>;;
>
>*)
>
>postevent $ERROR_PRIORITY "usage: $0 {start|stop|check}"
>
>exit 1
>
>;;
>
>esac
>
>postevent "" success
>
>exit 0
>
>
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
><HTML>
><HEAD>
><TITLE></TITLE>
></HEAD>
><BODY>
><!-- Converted from text/plain format -->
>
><P><FONT SIZE=2>I'm running a script that does continuous ftp of files to a
given ftp<BR>
>server. When started manually, it runs fine. When started using CAA, it<BR>
>gives the following error,<BR>
><BR>
><BR>
><BR>
>EVM alert [sauga01.mtn.co.ug]: CAAD[524900]: `streamserve` on `sauga01`
went<BR>
>OFFLINE unexpectedly<BR>
><BR>
>in the CAA script I run the following to stop the application<BR>
><BR>
>kill `ps -e | grep streamserve.sh | grep -v "grep" | cut -d "
" -f 1`<BR>
><BR>
>I need help on this error<BR>
><BR>
>Attached are my profile and script<BR>
><BR>
>Profile<BR>
><BR>
>NAME=streamserve<BR>
><BR>
>TYPE=application<BR>
><BR>
>ACTION_SCRIPT=streamserve.scr<BR>
><BR>
>ACTIVE_PLACEMENT=0<BR>
><BR>
>AUTO_START=1<BR>
><BR>
>CHECK_INTERVAL=60<BR>
><BR>
>DESCRIPTION=streamserve<BR>
><BR>
>FAILOVER_DELAY=0<BR>
><BR>
>FAILURE_INTERVAL=40<BR>
><BR>
>FAILURE_THRESHOLD=3<BR>
><BR>
>HOSTING_MEMBERS=sauga02 sauga01<BR>
><BR>
>OPTIONAL_RESOURCES=<BR>
><BR>
>PLACEMENT=restricted<BR>
><BR>
>REQUIRED_RESOURCES=<BR>
><BR>
>RESTART_ATTEMPTS=1<BR>
><BR>
>SCRIPT_TIMEOUT=60<BR>
><BR>
>Script<BR>
><BR>
><BR>
><BR>
>SERVICE_NAME="streamserve"<BR>
><BR>
>PROBE_PROCS="/usr/scripts/streamserve.sh"<BR>
><BR>
>START_APPCMD="/usr/scripts/streamserve.sh"<BR>
><BR>
>STOP_APPCMD="/usr/scripts/streamservestop.sh"<BR>
><BR>
>APPDIR="/usr/scripts"<BR>
><BR>
>export SERVICE_NAME START_APPCMD START_APPCMD2<BR>
><BR>
>export APPDIR PROBE_PROCS STOP_APPCMD STOP_APPCMD2<BR>
><BR>
>DEBUG_PRIORITY=100<BR>
><BR>
>INFO_PRIORITY=200<BR>
><BR>
>ERROR_PRIORITY=500<BR>
><BR>
>SCRIPT=$0<BR>
><BR>
>ACTION=$1 # Action (start, stop or check)<BR>
><BR>
>EVMPOST="/usr/bin/evmpost" # EVM command to post events<BR>
><BR>
>DEBUG=0<BR>
><BR>
>if [[ "$CAA_SCRIPT_DEBUG" != "" ]]; then<BR>
><BR>
>DEBUG=1<BR>
><BR>
>EVMPOST="/usr/bin/evmpost -r | /usr/bin/evmshow -d"<BR>
><BR>
>fi<BR>
><BR>
>export EVMPOST ACTION SCRIPT<BR>
><BR>
>etpid () {<BR>
><BR>
>if [ -n "$1" ]; then<BR>
><BR>
>GETMYPID=$1<BR>
><BR>
>shift<BR>
><BR>
>/bin/ps -e -o pid,command $* | while read mypid command args<BR>
><BR>
>do<BR>
><BR>
>if [ "$command" = "$GETMYPID" ]; then<BR>
><BR>
>echo "$mypid"<BR>
><BR>
>fi<BR>
><BR>
>done<BR>
><BR>
>fi<BR>
><BR>
>}<BR>
><BR>
>zapdaemon () {<BR>
><BR>
>typeset ret=0<BR>
><BR>
>for i in ${1}<BR>
><BR>
>do<BR>
><BR>
>checkdaemon ${i}<BR>
><BR>
>if [ $? -ne 0 ]; then<BR>
><BR>
>kill `getpid ${i}`<BR>
><BR>
>checkdaemon ${i}<BR>
><BR>
>if [ $? -ne 0 ]; then<BR>
><BR>
>kill -9 `getpid ${i}`<BR>
><BR>
>checkdaemon ${i}<BR>
><BR>
>if [ $? -ne 0 ]; then<BR>
><BR>
>postevent $ERROR_PRIORITY "${i}: stuck - could not kill -KIL<BR>
><BR>
>L"<BR>
><BR>
>ret=1<BR>
><BR>
>else<BR>
><BR>
>postevent $ERROR_PRIORITY "${i}: killed with -KILL"<BR>
><BR>
>fi<BR>
><BR>
>else<BR>
><BR>
>postevent "" "${i}: killed"<BR>
><BR>
>fi<BR>
><BR>
>fi<BR>
><BR>
>done<BR>
><BR>
>return $ret<BR>
><BR>
>}<BR>
><BR>
>probeapp () {<BR>
><BR>
>checkdaemon $1<BR>
><BR>
>if [ $? -ne 0 ]; then<BR>
><BR>
>postevent $DEBUG_PRIORITY "$1 check OK"<BR>
><BR>
>return 0<BR>
><BR>
>else<BR>
><BR>
>postevent $DEBUG_PRIORITY "$1 check failed"<BR>
><BR>
>return 1<BR>
><BR>
>fi<BR>
><BR>
>}<BR>
><BR>
>case $1 in<BR>
><BR>
>'start')<BR>
><BR>
>postevent $DEBUG_PRIORITY "trying to start"<BR>
><BR>
>cd $APPDIR<BR>
><BR>
>if [ "$START_APPCMD" != "" ]; then<BR>
><BR>
>$START_APPCMD &<BR>
><BR>
>if [ $? -ne 0 ]; then<BR>
><BR>
>postevent $ERROR_PRIORITY "start: $out"<BR>
><BR>
>exit 1<BR>
><BR>
>fi<BR>
><BR>
>fi<BR>
><BR>
><BR>
><BR>
>'stop')<BR>
><BR>
>postevent $DEBUG_PRIORITY "trying to stop"<BR>
><BR>
>cd $APPDIR<BR>
><BR>
>if [ "$STOP_APPCMD" != "" ]; then<BR>
><BR>
>$STOP_APPCMD &<BR>
><BR>
>if [ $? -ne 0 ]; then<BR>
><BR>
>postevent $ERROR_PRIORITY "stop: $out"<BR>
><BR>
>exit 1<BR>
><BR>
>fi<BR>
><BR>
>fi<BR>
><BR>
>if [ $STOP_APPCMD2 != "" ]; then<BR>
><BR>
>$STOP_APPCMD2 &<BR>
><BR>
>if [ $? -ne 0 ]; then<BR>
><BR>
>postevent $ERROR_PRIORITY "stop 2: $out"<BR>
><BR>
>exit 1<BR>
><BR>
>fi<BR>
><BR>
>fi<BR>
><BR>
>if [ "$START_APPCMD2" != "" ]; then<BR>
><BR>
>$START_APPCMD2 &<BR>
><BR>
>if [ $? -ne 0 ]; then<BR>
><BR>
>postevent $ERROR_PRIORITY "start 2: $out"<BR>
><BR>
>exit 1<BR>
><BR>
>fi<BR>
><BR>
>fi<BR>
><BR>
>;;<BR>
><BR>
>for i in ${PROBE_PROCS}; do<BR>
><BR>
>zapdaemon ${i}<BR>
><BR>
>done<BR>
><BR>
>;;<BR>
><BR>
>'check')<BR>
><BR>
>for i in ${PROBE_PROCS}; do<BR>
><BR>
>postevent $DEBUG_PRIORITY "trying to check $i"<BR>
><BR>
>probeapp $i<BR>
><BR>
>if [ $? -ne 0 ]; then<BR>
><BR>
>postevent "" "check failed for $i"<BR>
><BR>
>exit 1<BR>
><BR>
>fi<BR>
><BR>
>done<BR>
><BR>
>;;<BR>
><BR>
>*)<BR>
><BR>
>postevent $ERROR_PRIORITY "usage: $0 {start|stop|check}"<BR>
><BR>
>exit 1<BR>
><BR>
>;;<BR>
><BR>
>esac<BR>
><BR>
>postevent "" success<BR>
><BR>
>exit 0<BR>
><BR>
><BR>
></FONT>
></P>
>
></BODY>
></HTML>
next reply other threads:[~2002-07-31 13:46 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-31 13:46 Nelson Kawumi [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-10-10 9:34 help paf1
2002-10-04 19:54 Help Fabio Ferreira
2002-10-02 9:49 help ForgetS
2002-09-13 13:23 help Chris Ruhnke
2001-11-16 15:05 help Patrick Turner
2001-10-16 15:03 Help Juan Carlos Cruz R.
2001-08-03 8:49 help Neven Kmetic
2001-05-02 16:35 Help alan
2001-03-03 13:43 Help ivan
2000-12-21 18:45 Help Vasil Stoichkov
2000-09-04 8:35 Help Gilbert Zimba
2000-08-30 9:59 HELP s.venkata ramana reddy
2000-06-28 6:00 help David Millsom
2000-05-08 14:40 Help Surendra Rajbanshi
2000-05-07 12:28 Help Surendra
1999-11-19 14:10 HELP Paul Crittenden
1999-07-12 18:38 HELP Darin Walters
1999-05-19 15:20 help Singh, Kavita
1999-03-25 15:34 help Rafael Najmanovich
1999-02-16 22:13 help Lubell, Bradford
1998-09-24 11:19 help Mark_Cuthbert
1998-07-22 13:10 Help sherman
1998-05-28 3:30 Help Hoai Tran
1998-04-02 10:17 help penny
1998-01-13 15:07 help Lou_A_Mullikin_at_32-bellevue
1997-12-24 23:41 help Jack Trachtman
1997-11-03 15:20 help Daryl Fallin
1997-10-29 20:59 help Bill & Sharon Garner
1997-09-03 15:31 HELP jamesnet
1997-08-14 4:42 help Quy Tran
1997-07-07 19:22 help Douglas Meldrum
1997-05-26 6:17 HELP szhaichi () public ! szptt ! net ! cn
1997-03-11 20:38 help erossi
1997-01-01 13:35 help Rajesh Kapoor
1996-12-06 2:01 help assa
1996-10-30 12:25 help krzysztof.mueller
1996-09-29 21:27 help Mahendra Vallabh (Mike)
1996-07-17 6:44 help Kjell Andresen
1996-06-13 13:10 help nelixer
1996-05-23 11:26 help lecoint
1996-04-30 9:56 help paul.ottaway
1996-01-09 12:40 help Harald Baumgartner
1995-12-20 16:06 help Andrea Crisanti
1995-10-27 8:33 help grscott
1995-09-20 10:29 help phbb
1995-08-30 14:19 help Johannes Roth
1995-07-20 8:26 help Peter Blaser
1995-06-21 18:12 HELP David C Mackensen
1995-05-31 17:44 help Carl Joel Kuzmich
1995-03-06 6:47 help linford
1995-02-10 21:51 help Frank Chin
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox