]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/check_for_zombie_jobs
regress: detect configure failure
[bacula/bacula] / regress / scripts / check_for_zombie_jobs
1 #!/bin/sh
2 #
3 # Check for zombie jobs (not terminated).
4 # Also scan logs for ERROR messages
5 #
6
7 . ./config
8
9 # check_for_zombie_jobs storage=STORAGE [client=localhost-fd]
10
11 if [ $# = 2 ] ; then
12     client="$2"
13 else 
14     client="client"
15 fi
16
17 ${bin}/bconsole -c ${scripts}/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
18 @output ${tmp}/dir.out
19 status dir
20 @output ${tmp}/fd.out
21 status ${client}
22 @output ${tmp}/sd.out
23 status $1
24 @output
25 quit
26 END_OF_DATA
27
28 export zstat
29 grep "No Jobs running." ${tmp}/dir.out 2>&1 >/dev/null
30 if [ $? != 0 ] ; then
31   echo " "
32   echo "  !!!! Zombie Jobs in Director !!!!"
33   echo "  !!!! Zombie Jobs in Director !!!!" >>test.out
34   cat ${tmp}/dir.out
35   echo " "
36   zstat=1
37   exit 1
38 fi
39 grep "No Jobs running." ${tmp}/fd.out 2>&1 >/dev/null
40 if [ $? != 0 ] ; then
41   echo " "
42   echo "  !!!! Zombie Jobs in File daemon !!!!"
43   echo "  !!!! Zombie Jobs in File daemon !!!!" >>test.out
44   cat ${tmp}/fd.out
45   echo " "
46   zstat=1
47   exit 1
48 fi
49 grep "No Jobs running." ${tmp}/sd.out 2>&1 >/dev/null
50 if [ $? != 0 ] ; then
51   echo " "
52   echo "  !!!! Zombie Jobs in Storage daemon !!!!"
53   echo "  !!!! Zombie Jobs in Storage daemon !!!!" >>test.out
54   cat ${tmp}/sd.out
55   echo " "
56   zstat=1
57   exit 1
58 fi
59 grep " READ " ${tmp}/sd.out 2>&1 >/dev/null
60 if [ $? = 0 ]; then
61   echo " "
62   echo "  !!!! Zombie \"Read\" Jobs in Storage daemon !!!!"
63   echo "  !!!! Zombie \"Read\" Jobs in Storage daemon !!!!" >>test.out
64   cat ${tmp}/sd.out
65   echo " "
66   zstat=1
67   exit 1
68 fi
69 grep "ERROR" ${tmp}/log*.out 2>&1 >/dev/null
70 if [ $? = 0 ] ; then
71   echo " "
72   echo "  !!!! ERROR in log output !!!!"
73   echo "  !!!! ERROR in log output !!!!" >>test.out
74   grep "ERROR" ${tmp}/log*.out
75   echo " "
76   zstat=1
77   exit 1
78 fi
79 grep "Fatal Error" ${tmp}/log*.out 2>&1 >/dev/null
80 if [ $? = 0 ] ; then
81   echo " "
82   echo "  !!!! Fatal Error in log output !!!!"
83   echo "  !!!! Fatal Error in log output !!!!" >>test.out
84   grep "Fatal Error" ${tmp}/log*.out
85   echo " "
86   zstat=1
87   exit 1
88 fi
89
90 grep "glibc detected" ${tmp}/log*.out 2>&1 >/dev/null
91 if [ $? = 0 ] ; then
92   echo " "
93   echo "  !!!! glibc detected Error in log output !!!!"
94   echo "  !!!! glibc detected Error in log output !!!!" >>test.out
95   grep "glibc detected" ${tmp}/log*.out
96   echo " "
97   zstat=1
98   exit 1
99 fi