#!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to create own systemd services or udev rules # to run scripts during boot instead of using this file. # # In contrast to previous versions due to parallel execution during boot # this script will NOT be run after all other services. # # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure # that this script will be executed during boot. #touch /var/lock/subsys/local # rc.local envinronment is empty but I need all the kubernetes environment variables # to go further and configure the services. # As systemd is the container entry point it gets the environment variables from kubernetes # and I can source them for further use. #if [ -e /proc/1/environ ]; then # while read -d $'\0' ENV; do export "$ENV"; done < /proc/1/environ #fi printenv > /tmp/rc.local.shared logfile="/var/log/${MY_NAME}-${MY_CONTAINER}.log" if [ $(echo ${MY_NAME} | grep -s '^ctafrontend') ]; then 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 if [ $(echo ${MY_NAME} | grep -s '^ctaeos') ]; then echo "Running /shared/ctaeos-mgm.sh" &> ${logfile} /opt/run/bin/ctaeos-mgm.sh 2>&1 | tee -a ${logfile} fi if [ $(echo ${MY_NAME} | grep -s '^client') ]; then echo "Running /shared/client.sh" &> ${logfile} /opt/run/bin/client.sh 2>&1 | tee -a ${logfile} fi echo "DONE" >> ${logfile}