#!/bin/bash touch /var/lock/subsys/local # for now we do tests using locally hackable resources mounter in /shared #echo -n "Waiting for /shared/rc.local" > /tmp/rc.log #for ((;;)); do test -e /shared/rc.local && break; sleep 1; echo -n . >> /tmp/rc.log; done #echo OK >> /tmp/rc.log # 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 later use. if [ -e /proc/1/environ ]; then while read -d $'\0' ENV; do export "$ENV"; done < /proc/1/environ fi printenv > /tmp/rc.local # Let the next step take over ## we can override the default by providing content in the shared folder test -e /shared/rc.local && exec /shared/rc.local exec /opt/run/bin/rc.local.shared