From 5878757d262842e497f584d870c3d7f4b936c3fd Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Mon, 15 Aug 2016 10:03:08 +0800 Subject: [PATCH] Fix the Ubuntu Xenial build gate Ubuntu xenial use systemd service manager. Change the setup_Debian.sh script to handle this. Change-Id: I1f6487b73b1635e6dce0c68d3d7e1a158b427797 Partial-Bug: #1612887 --- tools/setup_Debian.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tools/setup_Debian.sh b/tools/setup_Debian.sh index 33fa8b16db..ce167bb719 100755 --- a/tools/setup_Debian.sh +++ b/tools/setup_Debian.sh @@ -51,17 +51,31 @@ function setup_disk { # (SamYaple)TODO: Remove the path overriding export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +source /etc/lsb-release + # Setup Docker repo and add signing key -echo 'deb http://apt.dockerproject.org/repo ubuntu-trusty main' | sudo tee /etc/apt/sources.list.d/docker.list +echo "deb http://apt.dockerproject.org/repo ubuntu-${DISTRIB_CODENAME} main" | sudo tee /etc/apt/sources.list.d/docker.list add_key sudo apt-get update sudo apt-get -y install --no-install-recommends docker-engine btrfs-tools sudo service docker stop setup_disk -echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker -sudo mount --make-shared /run -sudo service docker start +if [[ ${DISTRIB_CODENAME} == "trusty" ]]; then + echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker + sudo mount --make-shared /run + sudo service docker start +else + sudo mkdir /etc/systemd/system/docker.service.d + sudo tee /etc/systemd/system/docker.service.d/kolla.conf << EOF +[Service] +ExecStart= +ExecStart=/usr/bin/dockerd --storage-driver btrfs +MountFlags=shared +EOF + sudo systemctl daemon-reload + sudo systemctl start docker +fi sudo docker info