diff --git a/image_scripts/eos_fst_setup.sh b/image_scripts/eos_fst_setup.sh index e2c9533fbc81c9e02f6d4747aec35755421612b6..53a2e1e4576865646f3ba0bf80dc9665ba5569cb 100755 --- a/image_scripts/eos_fst_setup.sh +++ b/image_scripts/eos_fst_setup.sh @@ -1,6 +1,28 @@ #!/usr/bin/env bash +if [[ $# -eq 0 ]]; then + echo "Usage: $0 <id> [-u <uuid>] [-d <mountpoint>] [-s <space>] [-c <configstatus>]" + exit 1 +fi + id=$1 +shift + +UUID=fst${id} +DATADIR=/home/data/eos${id} +SPACE=default +CONFIG=rw + +while getopts 'u:d:s:c:' flag; do + case "${flag}" in + u) UUID="${OPTARG}" ;; + d) DATADIR="${OPTARG}" ;; + s) SPACE="${OPTARG}" ;; + c) CONFIG="${OPTARG}" ;; + *) echo "Unexpected option ${flag}" ;; + esac +done + FSTHOSTNAME=$(hostname -f) source /etc/sysconfig/eos export EOS_MGM_URL=root://eos-mgm-test.eoscluster.cern.ch// @@ -8,12 +30,11 @@ export EOS_MGM_URL=root://eos-mgm-test.eoscluster.cern.ch// echo "Starting fst${id} ..." /usr/bin/xrootd -n fst${id} -c /etc/xrd.cf.fst -l /var/log/eos/xrdlog.fst -b -Rdaemon echo "Configuring fst${id} ..." -UUID=fst${id} -DATADIR=/home/data/eos${id} + mkdir -p $DATADIR echo "$UUID" > $DATADIR/.eosfsuuid echo "${id}" > $DATADIR/.eosfsid chown -R daemon:daemon $DATADIR -eos -b fs add -m ${id} $UUID $FSTHOSTNAME:1095 $DATADIR default rw +eos -b fs add -m ${id} $UUID $FSTHOSTNAME:1095 $DATADIR $SPACE $CONFIG eos -b node set $FSTHOSTNAME:1095 on echo "Configuration done for fst${id}" diff --git a/scripts/start_services.sh b/scripts/start_services.sh index ee271d676a6f1ddf5af7aa8b128a4f994d4a62e0..62fbb8732930f7d74ef249f6dec287637d40a31f 100755 --- a/scripts/start_services.sh +++ b/scripts/start_services.sh @@ -66,7 +66,7 @@ for PID in ${PIDS}; do done if [ "${FAILURE}" == "1" ]; then - echo "Failed to start one of the fsts"; + echo "Failed to start one of the FSTs"; exit 1 fi @@ -84,7 +84,7 @@ for PID in ${PIDS}; do done if [ "${FAILURE}" == "1" ]; then - echo "Failed to configure one of the fsts" + echo "Failed to configure one of the FSTs" exit 1 fi