]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
systemd support for cinder-backup
authorgustavo panizzo <gfa@zumbi.com.ar>
Tue, 5 Aug 2014 05:35:10 +0000 (02:35 -0300)
committergustavo panizzo <gfa@zumbi.com.ar>
Tue, 5 Aug 2014 05:35:10 +0000 (02:35 -0300)
Rewritten-From: b49e5d3aa2553242262219943543a3af58fb7602

xenial/debian/cinder-backup.init
xenial/debian/cinder-backup.service [new file with mode: 0644]

index 0376386d3437a1d042a5e68095ea2b3c2b998e77..d7f2b6cb91ac178c18a95053cd31655d441238a0 100644 (file)
@@ -19,7 +19,7 @@ DESC="OpenStack Cinder Backup"
 NAME=cinder-backup
 DAEMON=/usr/bin/cinder-backup
 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/
@@ -27,8 +27,8 @@ 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
 
@@ -73,6 +73,12 @@ stop)
 status)
        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
 ;;
+systemd-start)
+    do_start
+;;
+systemd-stop)
+    do_stop
+;;
 restart|force-reload)
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
diff --git a/xenial/debian/cinder-backup.service b/xenial/debian/cinder-backup.service
new file mode 100644 (file)
index 0000000..6ba554f
--- /dev/null
@@ -0,0 +1,17 @@
+[Unit]
+Description=OpenStack Cinder Backup
+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-backup systemd-start
+ExecStop=/etc/init.d/cinder-backup systemd-stop
+PIDFile=/var/run/cinder/cinder-backup.pid
+Restart=on-failure
+Type=forking
+
+[Install]
+WantedBy=multi-user.target
+