2014-04-27 21:46:59 +00:00
|
|
|
#!/bin/sh
|
2014-06-10 00:05:16 +00:00
|
|
|
|
2014-04-27 21:46:59 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
[ -d /dev/net ] ||
|
|
|
|
mkdir -p /dev/net
|
|
|
|
[ -c /dev/net/tun ] ||
|
|
|
|
mknod /dev/net/tun c 10 200
|
|
|
|
|
2014-08-05 14:18:19 +00:00
|
|
|
cd /app
|
|
|
|
|
2015-01-02 17:34:42 +00:00
|
|
|
mkdir -p /var/log/supervisor && touch /var/log/supervisor/supervisord.log
|
2015-08-06 16:05:47 +00:00
|
|
|
mkdir -p /var/run/resin
|
|
|
|
mount -t tmpfs -o size=1m tmpfs /var/run/resin
|
2015-01-02 17:34:42 +00:00
|
|
|
|
2015-08-06 16:05:47 +00:00
|
|
|
if [ -z "$GOSUPER_SOCKET" ]; then
|
|
|
|
export GOSUPER_SOCKET=/var/run/resin/gosuper.sock
|
|
|
|
fi
|
2015-12-21 14:44:43 +00:00
|
|
|
if [ -z "$DOCKER_SOCKET" ]; then
|
|
|
|
export DOCKER_SOCKET=/run/docker.sock
|
|
|
|
fi
|
2016-01-05 13:55:58 +00:00
|
|
|
if [ -z "$HOST_PROC" ]; then
|
|
|
|
export HOST_PROC=/mnt/root/proc
|
|
|
|
fi
|
|
|
|
|
2015-09-09 14:32:37 +00:00
|
|
|
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/mnt/root/run/dbus/system_bus_socket"
|
2015-08-06 16:05:47 +00:00
|
|
|
|
2016-06-09 05:15:24 +00:00
|
|
|
# If docker data directory isn't mounted in the default path, symlink it
|
|
|
|
if [ ! -d /var/lib/docker ]; then
|
|
|
|
ln -s "$DOCKER_ROOT" /var/lib/docker
|
|
|
|
fi
|
|
|
|
|
2015-01-02 17:34:42 +00:00
|
|
|
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
|
|
|
|
|
|
|
supervisorctl start resin-supervisor
|
2015-07-23 17:00:37 +00:00
|
|
|
supervisorctl start go-supervisor
|
2015-01-02 17:34:42 +00:00
|
|
|
|
2016-05-28 19:12:08 +00:00
|
|
|
tail -F \
|
|
|
|
/var/log/supervisor/supervisord.log \
|
|
|
|
/var/log/resin_supervisor_stdout.log
|