-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsync_conf2fst
executable file
·52 lines (39 loc) · 1.34 KB
/
sync_conf2fst
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
#!/usr/bin/env bash
TGT="${1}"
shift
FST_LIST_ALL="fst01 fst02 fst03 fst04 fst05 fst06 fst07 fst08 fst09 fst10 fst11 fst12 fst13 fst14 fst15"
CTRL_OPT="-o ControlMaster=auto -o ControlPersist=120 -o ControlPath=~/.ssh/%r@%h:%p"
SCP_CMD="scp -4 -B -C -p ${CTRL_OPT}"
cp /etc/sysconfig/eos_env /tmp/eos_env
sed --follow-symlinks -i "/^XRD_ROLES=/s/.*/XRD_ROLES=\"fst\"/" /tmp/eos_env
sync_conf2fst () {
local FST
FST="${1}"
${SCP_CMD} /tmp/eos_env ${FST}:/etc/sysconfig/
${SCP_CMD} /etc/gai.conf ${FST}:/etc/
${SCP_CMD} /etc/xrd.cf.fst ${FST}:/etc/
${SCP_CMD} /etc/eos.keytab ${FST}:/etc/
${SCP_CMD} /etc/quarkdb.pass ${FST}:/etc/
${SCP_CMD} /etc/ganglia/gmond.conf ${FST}:/etc/ganglia/
${SCP_CMD} /etc/mlsensor/mlsensor.properties ${FST}:/etc/mlsensor/
${SCP_CMD} iptables/iptables ${FST}:/etc/sysconfig/
${SCP_CMD} iptables/ip6tables ${FST}:/etc/sysconfig/
# ssh ${CTRL_OPT} ${FST} "mkdir -p /etc/systemd/system/[email protected]/"
# ${SCP_CMD} /etc/systemd/system/[email protected]/override.conf ${FST}:/etc/systemd/system/[email protected]/
}
export -f sync_conf2fst
if [[ $# -eq 0 ]] ; then
FST_LIST="${FST_LIST_ALL}"
else
FST_LIST="$*"
fi
for fst in ${FST_LIST} ; do
{ sync_conf2fst ${fst}; } &
done
wait
rm -rf /tmp/eos_env
echo 'Now run:
ssh fstX "systemctl restart eos@fst"
OR
for i in $(seq -w 1 15); do ssh fst${i} "systemctl restart eos@fst"; done
'