aboutsummaryrefslogtreecommitdiff
path: root/docker/base/start.sh
blob: a42c01391da5891d0f421f98c7b803c607b87a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -o errexit

# TODO(SamYaple): After we merge Heka it should be possible to remove
# this symlink, investigate that after Heka is finalized
# NOTE(SamYaple): Setting up logging socket to /dev/log
if [[ ! "${!SKIP_LOG_SETUP[@]}" && -e /var/lib/kolla/rsyslog ]]; then
    while [[ ! -S /var/lib/kolla/rsyslog/log ]]; do
        sleep 1
    done
    sudo ln -sf /var/lib/kolla/rsyslog/log /dev/log
fi

# Wait for the log socket
if [[ ! "${!SKIP_LOG_SETUP[@]}" && -e /var/lib/kolla/heka ]]; then
    while [[ ! -S /var/lib/kolla/heka/log ]]; do
        sleep 1
    done
fi

# Processing /var/lib/kolla/config_files/config.json as root.  This is necessary
# to permit certain files to be controlled by the root user which should
# not be writable by the dropped-privileged user, especially /run_command
sudo -E kolla_set_configs
CMD=$(cat /run_command)
ARGS=""

# Run additional commands if present
source kolla_extend_start

echo "Running command: '${CMD}${ARGS:+ $ARGS}'"
exec ${CMD} ${ARGS}