2016-04-14 13:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
[ -d /dev/net ] ||
|
|
|
|
mkdir -p /dev/net
|
|
|
|
[ -c /dev/net/tun ] ||
|
|
|
|
mknod /dev/net/tun c 10 200
|
|
|
|
|
|
|
|
mkdir -p /var/log/supervisor && touch /var/log/supervisor/supervisord.log
|
|
|
|
mkdir -p /var/run/resin
|
|
|
|
mount -t tmpfs -o size=1m tmpfs /var/run/resin
|
|
|
|
|
|
|
|
if [ -z "$GOSUPER_SOCKET" ]; then
|
|
|
|
export GOSUPER_SOCKET=/var/run/resin/gosuper.sock
|
|
|
|
fi
|
|
|
|
if [ -z "$DOCKER_SOCKET" ]; then
|
|
|
|
export DOCKER_SOCKET=/run/docker.sock
|
|
|
|
fi
|
|
|
|
if [ -z "$HOST_PROC" ]; then
|
|
|
|
export HOST_PROC=/mnt/root/proc
|
|
|
|
fi
|
|
|
|
|
|
|
|
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/mnt/root/run/dbus/system_bus_socket"
|
|
|
|
|
2016-06-23 18:07:18 +00:00
|
|
|
# If DOCKER_ROOT isn't set then default it
|
|
|
|
if [ -z "${DOCKER_ROOT}" ]; then
|
|
|
|
DOCKER_ROOT=/mnt/root/var/lib/rce
|
|
|
|
fi
|
|
|
|
# Mount the DOCKER_ROOT path equivalent in the container fs
|
|
|
|
DOCKER_LIB_PATH=${DOCKER_ROOT#/mnt/root}
|
|
|
|
if [ ! -d "${DOCKER_LIB_PATH}" ]; then
|
|
|
|
ln -s "${DOCKER_ROOT}" "${DOCKER_LIB_PATH}"
|
|
|
|
fi
|
|
|
|
|
2016-04-14 13:04:46 +00:00
|
|
|
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
|
|
|
|
|
|
|
supervisorctl -c /etc/supervisor/supervisord.conf start resin-supervisor
|
|
|
|
supervisorctl -c /etc/supervisor/supervisord.conf start go-supervisor
|
|
|
|
|
2016-05-28 19:12:08 +00:00
|
|
|
tail -F \
|
|
|
|
/var/log/supervisor/supervisord.log \
|
|
|
|
/var/log/resin_supervisor_stdout.log
|