Commit 643556b9 authored by James Clark's avatar James Clark
Browse files

fts-proxy now kubernetized

parent a68c1d5d
Pipeline #83146 passed with stages
in 1 minute and 32 seconds
#!/bin/bash
#
# fts_proxy
#
# james alexander clark <james.clark@.ligo.org>
#
# Create an x509 proxy from the host's igtf grid certificate and delegate
# against the osg fts server at https://fts.mwt2.org:8446. Run this script (as
# root) as a cronjob to maintain an FTS-delegated proxy for rucio operations.
#
## Configuration
ftsproxylog=/var/log/rucio/fts-proxy.log
#proxytool=/usr/bin/grid-proxy-init
proxytool="/usr/bin/voms-proxy-init -voms virgo:/virgo/virgo -hours 24 -dont-verify-ac"
hostcert=/etc/grid-security/hostcert.pem
hostkey=/etc/grid-security/hostkey.pem
x509proxy=/opt/rucio/etc/web/x509up
ftsdelegate=/bin/fts-rest-delegate
#ftsserver=https://fts.mwt2.org:8446
ftsserver=https://fts3-pilot.cern.ch:8446
## Logging info
dtstamp="`date +%F-%A-%H.%M.%S `"
echo -e "\n################ ${dtstamp} ################" >> ${ftsproxylog}
## Create robot proxy
echo -e "${dtstamp}: ${proxytool} -cert ${hostcert} -key ${hostkey} -out ${x509proxy} -debug "
${proxytool} -cert ${hostcert} -key ${hostkey} -out ${x509proxy} -debug 2>> ${ftsproxylog} 2>&1
proxy_ret=$?
echo -e "${dtstamp}: ${proxytool} return: ${proxy_ret}\n" >> ${ftsproxylog} 2>&1
## Delgate proxy
echo -e "${ftsdelegate} -f -v -s ${ftsserver} --cert ${x509proxy} --key ${x509proxy}" >> ${ftsproxylog} 2>&1
${ftsdelegate} -f -v -s ${ftsserver} --cert ${x509proxy} --key ${x509proxy} >> ${ftsproxylog} 2>&1
delegate_ret=$?
echo -e "${dtstamp}: ${ftsdelegate} return: ${delegate_ret}" >> ${ftsproxylog} 2>&1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment