# 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 "$AF_ACCOUNT_NAME" ]; then echo "AF_ACCOUNT_NAME not defined in $cfg."; exit 1; fi if [ -z "$AF_ACCOUNT_KEY" ]; then echo "AF_ACCOUNT_KEY not defined in $cfg."; exit 1; fi echo "Parsed configuration correctly." export AZURE_STORAGE_ACCOUNT="$AF_ACCOUNT_NAME" export AZURE_STORAGE_ACCOUNT_KEY="$AF_ACCOUNT_KEY" export AZURE_STORAGE_BASE="$AZURE_STORAGE_BASE" exec "$AF_CMD" $AF_OPTS 2>&1 end script