From 0d37d3972432832a42ad6355a033067f3b92d707 Mon Sep 17 00:00:00 2001 From: John Griffith Date: Thu, 8 Sep 2016 15:45:44 +0000 Subject: [PATCH] Update install script Update a few things in the install script: 1. Don't use sudo inside the script, leave it to caller to execute with sudo 2. Create a systemd file for the service Will now log to /var/log/syslog like other systemd services. Use journalctl to filter on cinder-docker-driver --- install.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) mode change 100644 => 100755 install.sh diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index 3ba98a3..fc57dae --- a/install.sh +++ b/install.sh @@ -12,10 +12,27 @@ DRIVER_URL="https://github.com/j-griffith/cinder-docker-driver/releases/download BIN_DIR="/usr/bin" do_install() { -sudo mkdir -p /var/lib/cinder/dockerdriver -sudo mkdir -p /var/lib/cinder/mount -sudo curl -sSL -o $BIN_DIR/$BIN_NAME $DRIVER_URL -sudo chmod +x $BIN_DIR/$BIN_NAME +mkdir -p /var/lib/cinder/dockerdriver +mkdir -p /var/lib/cinder/mount +rm $BIN_DIR/$BIN_NAME +curl -sSL -o $BIN_DIR/$BIN_NAME $DRIVER_URL +chmod +x $BIN_DIR/$BIN_NAME +echo " +[Unit] +Description=\"Cinder Docker Plugin daemon\" +Before=docker.service +Requires=cinder-docker-driver.service + +[Service] +TimeoutStartSec=0 +ExecStart=/usr/bin/cinder-docker-driver & + +[Install] +WantedBy=docker.service" >/etc/systemd/system/cinder-docker-driver.service + +chmod 644 /etc/systemd/system/cinder-docker-driver.service +systemctl daemon-reload +systemctl enable cinder-docker-driver } do_install