From a0896978463d5dbb0a50dbf33c5b54d8b0882a68 Mon Sep 17 00:00:00 2001 From: gustavo panizzo Date: Tue, 5 Aug 2014 02:34:58 -0300 Subject: [PATCH] systemd support for cinder-scheduler Rewritten-From: 1149e360374cc969dc1050b55461c00c20df4c81 --- xenial/debian/cinder-scheduler.init | 12 +++++++++--- xenial/debian/cinder-scheduler.service | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 xenial/debian/cinder-scheduler.service diff --git a/xenial/debian/cinder-scheduler.init b/xenial/debian/cinder-scheduler.init index 6a80b5f9a..63806a9ad 100644 --- a/xenial/debian/cinder-scheduler.init +++ b/xenial/debian/cinder-scheduler.init @@ -20,7 +20,7 @@ DESC="OpenStack Cinder Scheduler" NAME=cinder-scheduler DAEMON=/usr/bin/cinder-scheduler 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/ @@ -28,8 +28,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 @@ -74,6 +74,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-scheduler.service b/xenial/debian/cinder-scheduler.service new file mode 100644 index 000000000..52afe44ec --- /dev/null +++ b/xenial/debian/cinder-scheduler.service @@ -0,0 +1,17 @@ +[Unit] +Description=OpenStack Cinder Scheduler +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-scheduler systemd-start +ExecStop=/etc/init.d/cinder-scheduler systemd-stop +PIDFile=/var/run/cinder/cinder-scheduler.pid +Restart=on-failure +Type=forking + +[Install] +WantedBy=multi-user.target + -- 2.45.2