Skip to content

Commit

Permalink
Update install script
Browse files Browse the repository at this point in the history
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
  • Loading branch information
j-griffith committed Sep 8, 2016
1 parent 567099a commit 0d37d39
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0d37d39

Please sign in to comment.