batch-shipyard/resources/azurefile-dockervolumedrive...

40 строки
1.1 KiB
Plaintext

# Upstart init file for azurefile-dockervolumedriver
# You can configure /etc/default/azurefile-dockervolumedriver to set credentials.
#
# User Guide: https://github.com/Azure/azurefile-dockervolumedriver
#
description "Docker volume driver for Azure File Service"
author "Ahmet Alp Balkan"
start on starting docker
stop on runlevel [!2345] or stopping docker
respawn
kill timeout 20
script
set -e
AF_CMD=/usr/bin/$UPSTART_JOB
AF_OPTS=
if [ ! -f "/etc/default/$UPSTART_JOB" ]; then
echo "/etc/default/$UPSTART_JOB not found"
exit 1
fi
# Load configuration
cfg="/etc/default/$UPSTART_JOB"
. "$cfg"
if [ ! -x "$AF_CMD" ]; then echo "$AF_CMD not present or not executable."; exit 1; fi
if [ -z "$AZURE_STORAGE_ACCOUNT" ]; then echo "AZURE_STORAGE_ACCOUNT not defined in $cfg."; exit 1; fi
if [ -z "$AZURE_STORAGE_ACCOUNT_KEY" ]; then echo "AZURE_STORAGE_ACCOUNT_KEY not defined in $cfg."; exit 1; fi
echo "Parsed configuration correctly."
export AZURE_STORAGE_ACCOUNT="$AZURE_STORAGE_ACCOUNT"
export AZURE_STORAGE_ACCOUNT_KEY="$AZURE_STORAGE_ACCOUNT_KEY"
export AZURE_STORAGE_BASE="$AZURE_STORAGE_BASE"
exec "$AF_CMD" $AF_OPTS 2>&1
end script