-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinitialize_service.sh
executable file
·55 lines (52 loc) · 1.45 KB
/
initialize_service.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
#!/bin/bash
# Wait some time to allow the runControl to wake up
echo "Initializing SERVICE: $1"
if [ "X$1" == "XrunControl" ];
then
CMD="euRun.exe -a tcp://:44000"
elif [ "X$1" == "Xlogger" ];
then
sleep 3;
CMD="euLog.exe -r tcp://172.20.128.2:44000"
elif [ "X$1" == "XdataCollector" ];
then
sleep 6;
# Change the uid for the data
CMD="euDataCollector.exe -r tcp://172.20.128.2:44000"
elif [ "X$1" == "XonlineMon" ];
then
sleep 10;
CMD="OnlineMon.exe -tc 0 -sc 0 -r tcp://172.20.128.2:44000";
elif [ "X$1" == "XTestProducer" ];
then
sleep 20;
CMD="TestProducer.exe -r tcp://172.20.128.2:44000";
elif [ "X$1" == "XNIProducer" ];
then
sleep 20;
CMD="NIProducer.exe -r tcp://172.20.128.2:44000'";
elif [ "X$1" == "XTLU" ];
then
# Deal with the permissions for the TLU
# 1. check if the tlunoroot utility is compiled
# otherwise compile it
TLUCH=$(which tlunoroot)
if [ "X${TLUCH}" == "X" ];
then
sudo g++ -o /usr/bin/tlunoroot /eudaq/eudaq/producers/tlu/src/tlunoroot.cxx -lusb
TLUCH=$(which tlunoroot)
if [ "X${TLUCH}" == "X" ];
then
echo "ERROR: the utility tlunoroot NOT has been created!!"
exit -1;
fi;
# Change permissions
sudo chown root ${TLUCH}
sudo chmod u+s ${TLUCH}
fi;
# 2. Change permissions to the tlu
${TLUCH}
sleep 20;
CMD="TLUProducer.exe -r tcp://172.20.128.2:44000";
fi
exec ${CMD}