CE-cms-swinst 2.41 KB
Newer Older
Stefano Belforte's avatar
Stefano Belforte committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash

echo "<h2>Preliminary checks</h2>"
echo "<pre>"
set -x
voms-proxy-info -identity -fqan
id
set +x
echo "</pre>"

echo "<h2>Checking software directory for CMS VO</h2>"
vo_dir=$VO_CMS_SW_DIR
echo "Checking variable: \$VO_CMS_SW_DIR=$vo_dir"
echo "<pre>"
set -x
ls -ld $vo_dir
result=$?
set +x
echo "</pre>"
echo

if [ $result != 0 ]
    then
    echo "ERROR: software directory non existent or non readable"
    exit $SAME_ERROR
fi

echo "<pre>"
set -x
touch $vo_dir/.sametest
result=$?
set +x
echo "</pre>"
echo

if [ $result != 0 ]
    then
    echo "WARNING: cannot write to software area"
fi

echo "<h2>Sourcing the CMS environment</h2>"
echo "<pre>"
echo "source $VO_CMS_SW_DIR/cmsset_default.sh"
Andrea Sciaba's avatar
Andrea Sciaba committed
44
export SCRAM_ARCH=slc3_ia32_gcc323
Stefano Belforte's avatar
Stefano Belforte committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
source $VO_CMS_SW_DIR/cmsset_default.sh
result=$?
echo "</pre>"
echo

if [ $result != 0 ]
    then
    echo "ERROR: Could not find the CMS software initialisation script"
    exit $SAME_ERROR
fi

echo "<h2>Make sure configuration directory is there</h2>"
echo "Checking variable: \$CMS_PATH=$CMS_PATH"
echo "<p>"
if [ -z $CMS_PATH ]; then
    echo "ERROR: CMS_PATH not defined"
    exit $SAME_ERROR
fi

if [ ! -d $CMS_PATH ] ; then
    echo "ERROR: CMS_PATH directory $CMS_PATH not existing"
    exit $SAME_ERROR
fi

if [ ! -d $CMS_PATH/SITECONF/local/JobConfig ] ; then
    echo "ERROR: JobConfig directory $CMS_PATH/local/SITECONF/JobConfig not existing"
    exit $SAME_ERROR
fi
echo "<p>"
echo "OK"

echo "<h2>Make sure configuration file exists</h2>"

ConfigFile=${CMS_PATH}/SITECONF/local/JobConfig/site-local-config.xml
echo "Configuration file: $ConfigFile"
echo "<p>"

if [ ! -f $ConfigFile ] ; then
    echo "ERROR: Local Configuration file site-local-config.xml not existing"
    exit $SAME_ERROR
fi
echo "<p>"
echo "OK"

echo "<h2>Make sure local configuration file has entries for TriviaFileCatalog,
local stage out and Squid</h2>"

bad=0
grep -q "trivialcatalog" $ConfigFile
status=$?
if [ $status != 0 ] ; then
    echo "ERROR: TrivialFileCatlog string missing"
    bad=1
fi

grep -q "local-stage-out" $ConfigFile
status=$?
if [ $status != 0 ] ; then
    echo "ERROR: LocalStageOut string missing"
    bad=1
fi

grep -q "frontier-connect" $ConfigFile
status=$?
if [ $status != 0 ] ; then
    echo "ERROR: Frontier Configuration string missing"
    bad=1
fi

if [ $bad == 1 ] ; then
    echo "ERROR: invalid local configuration file $ConfigFile"
    exit $SAME_ERROR
fi
echo "<p>"
echo "OK"

exit $SAME_OK