30 lines
671 B
Bash
30 lines
671 B
Bash
#!/bin/bash
|
|
|
|
# Write environment variables to script
|
|
declare -p | grep -Ev 'BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID' > /container.env
|
|
chmod 744 /container.env
|
|
|
|
# Run startup scripts
|
|
for f in /etc/my_init.d/*.sh; do
|
|
echo "** Running startup script '$f'..."
|
|
bash "$f" -H
|
|
echo "** Startup script complete."
|
|
done
|
|
|
|
echo "** Running Supervisord..."
|
|
|
|
if [ "$1" = '--no-main-command' ]; then
|
|
exec /usr/bin/supervisord -c /etc/supervisor/supervisord-full.conf --nodaemon
|
|
fi
|
|
|
|
/usr/bin/supervisord -c /etc/supervisor/supervisord-minimal.conf
|
|
|
|
echo "** Supervisord started."
|
|
echo "** Running uptime_wait..."
|
|
|
|
uptime_wait
|
|
|
|
echo "** Services up and ready!"
|
|
|
|
exec "$@"
|