Skip to content
Snippets Groups Projects
Commit 6340a4f2 authored by Julien Leduc's avatar Julien Leduc
Browse files

Now taped and rmcd are systemctl ready.

parent edb9c60d
No related branches found
No related tags found
No related merge requests found
......@@ -6,9 +6,6 @@ if [ ! -e /etc/buildtreeRunner ]; then
yum-config-manager --enable cta-artifacts
yum-config-manager --enable ceph
yum-config-manager --enable castor
# Install missing RPMs
yum -y install mt-st mtx lsscsi sg3_utils cta-rmcd
fi
# source library configuration file
......@@ -17,8 +14,37 @@ echo "Using this configuration for library:"
cat /tmp/library-rc.sh
. /tmp/library-rc.sh
# to get rmcd logs to stdout
tail -F /var/log/cta/cta-rmcd.log &
ln -s /dev/${LIBRARYDEVICE} /dev/smc
/usr/bin/cta-rmcd -f /dev/smc
if [ "-${CI_CONTEXT}-" == '-systemd-' ]; then
# systemd is available
cat <<EOF >/etc/sysconfig/cta-rmcd
DAEMON_COREFILE_LIMIT=unlimited
CTA_RMCD_OPTIONS=/dev/smc
EOF
# install RPMs?
test -e /etc/buildtreeRunner || yum -y install mt-st mtx lsscsi sg3_utils cta-rmcd
# rmcd will be running as non root user, we need to fix a few things:
# device access rights
chmod 666 /dev/${LIBRARYDEVICE}
echo "Launching cta-rmcd with systemd:"
systemctl start cta-rmcd
echo "Status is now:"
systemctl status cta-rmcd
else
# systemd is not available
# install RPMs?
test -e /etc/buildtreeRunner || yum -y install mt-st mtx lsscsi sg3_utils cta-rmcd
# to get rmcd logs to stdout
tail -F /var/log/cta/cta-rmcd.log &
/usr/bin/cta-rmcd -f /dev/smc
fi
......@@ -17,9 +17,6 @@ cat /tmp/library-rc.sh
. /tmp/library-rc.sh
ln -s /dev/${LIBRARYDEVICE} /dev/smc
#/usr/bin/rmcd -f /dev/smc&
mkdir -p /etc/castor
tpconfig="${DRIVENAMES[${driveslot}]} ${LIBRARYNAME} /dev/${DRIVEDEVICES[${driveslot}]} smc${driveslot}"
......@@ -30,7 +27,7 @@ echo "Configuring database"
/opt/run/bin/init_database.sh
. /tmp/database-rc.sh
echo ${DATABASEURL} >/etc/cta/cta-catalogue.conf
echo ${DATABASEURL} > /etc/cta/cta-catalogue.conf
# cta-taped setup
echo "taped BufferCount 10" > /etc/cta/cta-taped.conf
......@@ -38,7 +35,6 @@ echo ${DATABASEURL} >/etc/cta/cta-catalogue.conf
echo "ObjectStore BackendPath $OBJECTSTOREURL" >> /etc/cta/cta-taped.conf
echo "${tpconfig}" > /etc/cta/TPCONFIG
####
# configuring taped using the official location for SSS: /etc/cta/cta-taped.sss.keytab
CTATAPEDSSS="cta-taped.sss.keytab"
......@@ -50,24 +46,34 @@ chmod 600 /etc/cta/${CTATAPEDSSS}
chown cta /etc/cta/${CTATAPEDSSS}
cat <<EOF > /etc/sysconfig/cta-taped
export CTA_TAPED_OPTIONS="--foreground -l /var/log/cta/cta-taped.log"
CTA_TAPED_OPTIONS="--log-to-file=/var/log/cta/cta-taped.log"
XrdSecPROTOCOL=sss
XrdSecSSSKT=/etc/cta/${CTATAPEDSSS}
EOF
export XrdSecPROTOCOL=sss
export XrdSecSSSKT=/etc/cta/${CTATAPEDSSS}
if [ "-${CI_CONTEXT}-" == '-systemd-' ]; then
# systemd is available
echo "Launching rmcd with systemd:"
systemctl start cta-taped
EOF
echo "Status is now:"
systemctl status cta-taped
. /etc/sysconfig/cta-taped
else
# systemd is not available
. /etc/sysconfig/cta-taped
tail -F /var/log/cta/cta-taped.log &
# cta-taped is ran with runuser to avoid a bug with Docker that prevents both
# the setresgid(-1, 1474, -1) and setresuid(-1, 14029, -1) system calls from
# working correctly
runuser -c "/usr/bin/cta-taped ${CTA_TAPED_OPTIONS}"
runuser -c "/usr/bin/cta-taped --foreground ${CTA_TAPED_OPTIONS}"
echo "taped died"
sleep infinity
fi
......@@ -22,9 +22,20 @@
printenv > /tmp/rc.local.shared
logfile="/var/log/${MY_NAME}.log"
logfile="/var/log/${MY_NAME}-${MY_CONTAINER}.log"
if [ $(echo ${MY_NAME} | grep -s '^ctafrontend') ]; then
echo "Running /shared/ctafrontend.sh" &> ${logfile}
echo "Running /opt/run/bin/ctafrontend.sh" &> ${logfile}
/opt/run/bin/ctafrontend.sh 2>&1 | tee -a ${logfile}
fi
if [ $(echo ${MY_CONTAINER} | grep -s '^rmcd') ]; then
echo "Running /opt/run/bin/rmcd.sh" &> ${logfile}
/opt/run/bin/rmcd.sh 2>&1 | tee -a ${logfile}
fi
if [ $(echo ${MY_CONTAINER} | grep -s '^taped') ]; then
echo "Running /opt/run/bin/taped.sh" &> ${logfile}
/opt/run/bin/taped.sh 2>&1 | tee -a ${logfile}
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment