-
Notifications
You must be signed in to change notification settings - Fork 4
/
installMonitor.sh
executable file
·75 lines (58 loc) · 2.34 KB
/
installMonitor.sh
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
44
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
#!/bin/bash
# --------------------------------------------------------------------------------------------------
#
# Installation script for IntelROCCS/Monitor. There will be lots of things to test and to fix, but
# this is the starting point. This installation has to be performed as user root.
#
# Ch.Paus: Version 0.0 (Jul 31, 2014)
# --------------------------------------------------------------------------------------------------
# Configuration parameters (this needs more work but for now)
export INTELROCCS_USER=cmsprod
export INTELROCCS_GROUP=zh
source Monitor/setupMonitor.sh
cp Monitor/html/custom.html /local/IntelROCCSplots/custom.html
cp Monitor/html/interactiveMonitor.py /var/www/cgi-bin/interactiveMonitor.cgi
cp Monitor/webPlotFromPickle.py /var/www/cgi-bin/webPlotFromPickle.py
cp Monitor/findDatasetProperties.py /var/www/cgi-bin/findDatasetProperties.py
cp Monitor/findDatasetHistoryAll.py /var/www/cgi-bin/findDatasetHistoryAll.py
cp Monitor/Dataset.py /var/www/cgi-bin/Dataset.py
# make sure mysql is setup properly for server and clients otherwise this will not work
# check out the README
# General installation (you have to be in the directory of install script and you have to be root)
TRUNC=`dirname $MONITOR_BASE`
# copy the software
#==================
if [ -d "$MONITOR_BASE" ]
then
# make sure to remove completely the previous installed software
echo " Removing previous installation."
rm -rf "$MONITOR_BASE"
fi
cp -r ../IntelROCCS/Monitor $TRUNC
# create log/db structure
#========================
# owner has to be $INTELROCCS_USER:$INTELROCCS_GROUP, this user runs the process
mkdir -p $MONITOR_DB
chown ${INTELROCCS_USER}:${INTELROCCS_GROUP} -R $MONITOR_DB
# install and start daemon
#=========================
# stop potentially existing server process
if [ -e "/etc/init.d/monitord" ]
then
/etc/init.d/monitord status
/etc/init.d/monitord stop
fi
# copy Monitor daemon
cp /usr/local/IntelROCCS/Monitor/sysv/monitord /etc/init.d/
# copy html files
cp ../IntelROCCS/Monitor/html/*html $MONITOR_DB
cp ../IntelROCCS/Monitor/html/*css $MONITOR_DB
chown ${INTELROCCS_USER}:${INTELROCCS_GROUP} -R $MONITOR_DB
# start new server
/etc/init.d/monitord status
/etc/init.d/monitord start
sleep 2
/etc/init.d/monitord status
# start on boot
chkconfig --level 345 monitord on
exit 0