NAME=cinder-volume
DAEMON=/usr/bin/cinder-volume
DAEMON_ARGS="--config-file=/etc/cinder/cinder.conf"
-PIDFILE=/var/run/$NAME.pid
+PIDFILE=/var/run/cinder/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
CINDER_USER=cinder
LOCK_DIR=/var/lock/cinder/
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
-mkdir -p ${LOCK_DIR}
-chown ${CINDER_USER} ${LOCK_DIR}
+mkdir -p ${LOCK_DIR} /var/run/cinder
+chown ${CINDER_USER} ${LOCK_DIR} /var/run/cinder
. /lib/lsb/init-functions
--- /dev/null
+[Unit]
+Description=OpenStack Cinder Volume
+Documentation=http://docs.openstack.org/
+After=postgresql.service mysql.service keystone.service rabbitmq-server.service ntp.service network.service
+
+[Service]
+User=cinder
+Group=cinder
+ExecStart=/etc/init.d/cinder-volume systemd-start
+ExecStop=/etc/init.d/cinder-volume systemd-stop
+PIDFile=/var/run/cinder/cinder-volume.pid
+Restart=on-failure
+Type=forking
+
+[Install]
+WantedBy=multi-user.target
+