source: branches/fscctrl_safety_limits/start.sh@ 19915

Last change on this file since 19915 was 18150, checked in by tbretz, 10 years ago
Little improvement to output. Times now in UTC.
  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/bash --login
2
3cd `dirname "$0"`
4
5CALL=`basename "$0"`
6LINK=`readlink "$0"`
7
8if [ -n "$LINK" -a $CALL != 'start.sh' ]; then
9 DIR=`dirname "$LINK"`
10 PRG=$DIR/$CALL
11 CMD=$PRG" "$*
12else
13 DIR=`dirname "$0"`
14 PRG=$DIR/$1
15 CMD=$DIR/$*
16fi
17
18if [ "$CALL" = "fadctrl" ]; then
19 NICE="ionice -c 2 -n 0"
20fi
21
22# echo DIR=$DIR
23# echo PRG=$PRG
24# echo CMD=$CMD
25
26while [ true ]; do
27
28 reset
29
30 if [ -n "$RC" ]; then
31 echo LAST RETURN CODE=$RC [`date -u`]
32 fi
33
34 echo COMMAND=$NICE $CMD
35 echo
36
37 if [ ! -x $PRG ]; then
38 echo $1 not available... waiting 5s.
39 sleep 5
40 continue
41 fi
42
43 if [ -e $DIR/compiling.lock ]; then
44 echo Compilation in progress... waiting 1s.
45 sleep 1
46 continue
47 fi
48
49 $NICE $CMD
50 RC=$?
51
52 echo RETURN CODE=$RC [`date -u`]
53 echo
54
55 # HUP 1 exit
56 # INT 2 exit
57 # QUIT 3 core
58 # ILL 4 core
59 # TRAP 5 core
60 # ABRT 6 core
61 # FPE 8 core
62 # KILL 9 exit
63 # SEGV 11 core
64 # PIPE 13 exit
65 # ALRM 14 exit
66 # TERM 15 exit
67
68 # 0 (User requested exit from the command line)
69 # 1- (Eval options failed, return code of StateMachineImp::Run)
70 # 126 (exit requested from recompile.sh)
71 # 127 (problem with option parsing or no program start, like --help)
72 # 128 (exit(128))
73 # 134 (ABRT, double corruption, abort())
74 # 139 (SEGV, 128+11)
75 # 255 (exception)
76
77 if [ $RC -eq 126 ]; then
78 continue
79 fi
80
81 # RC<=128 || RC==KILL || RC=TERM || RC=exception
82 if [ $RC -le 128 ] || [ $RC -eq 137 ] || [ $RC -eq 143 ] || [ $RC -eq 255 ] ]; then
83 exit
84 fi
85
86done
Note: See TracBrowser for help on using the repository browser.