Use exec to redirect headless logs in enable op

Fixes weird issue with CentOS where docker-exntesion stops
receiving output from `yum install` and eventually crashes.

Addresses #73.
This commit is contained in:
Ahmet Alp Balkan 2016-02-27 08:15:16 +00:00
Родитель f295149311
Коммит 3d4141b6fc
2 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -18,7 +18,7 @@ This will compile and create the extension handler zip package to `bundle/` dire
### 2. Upload the package
Extension follows the semantic versioning [MAJOR].[MINOR].[PATCH]. The MAJOR/MINOR
are stored in the `Makefile` and PATCH is the build date of the bundle in `yymmddHHMM`
are stored in the `Makefile` and PATCH is the UTC build date of the bundle in `yymmddHHMM`
format.
* **Bump `MAJOR` if**: you are introducing breaking changes in the config schema

Просмотреть файл

@ -2,6 +2,11 @@
set -eu
readonly SCRIPT_DIR=$(dirname $0)
# Script logs its output (stdout/stderr) simultaneously to a file
# as waagent does not capture output of processes it starts.
exec > >(tee -ia /var/log/azure-docker-extension-enable.log)
exec 2>&1
# This script kicks off the ./bin/docker-extension in the
# background and disowns it with nohup. This is a workaround
# for the 5-minute time limit for 'enable' step and 15-minute
@ -53,4 +58,4 @@ write_status() {
write_status
set -x
nohup $(readlink -f "$SCRIPT_DIR/../bin/docker-extension") $@ > /var/log/nohup.log &
nohup $(readlink -f "$SCRIPT_DIR/../bin/docker-extension") $@ &