#!/bin/bash
set -eux

os-svc-daemon -i "$CINDER_VENV_DIR" cinder-volume cinder cinder-volume "--config-dir /etc/cinder"

# Ensure the loop block device is available
if [[ "ubuntu debian" =~ "$DISTRO_NAME" ]]; then
    if ! grep -Fxq loop /etc/modules; then
        echo "loop" >> /etc/modules
    fi
fi
