From ed536cea3e7c265660b8adf4a20ffb5fedec6076 Mon Sep 17 00:00:00 2001
From: Thomas Goirand <thomas@goirand.fr>
Date: Wed, 17 Apr 2013 16:45:37 +0800
Subject: [PATCH] Updated upstart scripts.

Rewritten-From: 27b8e7267f5f47c07366eff0982689d34a306ff6
---
 xenial/debian/cinder-api.upstart.in       | 5 +++--
 xenial/debian/cinder-scheduler.upstart.in | 5 +++--
 xenial/debian/cinder-volume.upstart.in    | 5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xenial/debian/cinder-api.upstart.in b/xenial/debian/cinder-api.upstart.in
index 1fbeb327a..2d6d07154 100644
--- a/xenial/debian/cinder-api.upstart.in
+++ b/xenial/debian/cinder-api.upstart.in
@@ -2,7 +2,7 @@ description "Cinder api server"
 author "Chuck Short <zulcss@ubuntu.com>"
 
 start on runlevel [2345]
-stop on runlevel [016]
+stop on runlevel [!2345]
 
 chdir /var/run
 
@@ -14,4 +14,5 @@ pre-start script
     chown cinder:root /var/lock/cinder
 end script
 
-exec su -s /bin/sh -c "exec cinder-api --config-file=/etc/cinder/cinder.conf --log-file=/var/log/cinder/cinder-api.log" cinder
+exec start-stop-daemon --start --chuid cinder --exec /usr/bin/cinder-api \
+     -- --config-file=/etc/cinder/cinder.conf --log-file=/var/log/cinder/cinder-api.log
diff --git a/xenial/debian/cinder-scheduler.upstart.in b/xenial/debian/cinder-scheduler.upstart.in
index d03cb4e21..c321041e5 100644
--- a/xenial/debian/cinder-scheduler.upstart.in
+++ b/xenial/debian/cinder-scheduler.upstart.in
@@ -2,7 +2,7 @@ description "Cinder scheduler server"
 author "Chuck Short <zulcss@ubuntu.com>"
 
 start on runlevel [2345]
-stop on runlevel [016]
+stop on runlevel [!2345]
 
 chdir /var/run
 
@@ -14,4 +14,5 @@ pre-start script
     chown cinder:root /var/lock/cinder
 end script
 
-exec su -s /bin/sh -c "exec cinder-scheduler --config-file=/etc/cinder/cinder.conf --log-file=/var/log/cinder/cinder-scheduler.log" cinder
+exec start-stop-daemon --start --chuid cinder --exec /usr/bin/cinder-scheduler \
+     -- --config-file=/etc/cinder/cinder.conf --log-file=/var/log/cinder/cinder-scheduler.log
diff --git a/xenial/debian/cinder-volume.upstart.in b/xenial/debian/cinder-volume.upstart.in
index 9544ec7c7..dd3295adf 100644
--- a/xenial/debian/cinder-volume.upstart.in
+++ b/xenial/debian/cinder-volume.upstart.in
@@ -2,7 +2,7 @@ description "Cinder volume server"
 author "Chuck Short <zulcss@ubuntu.com>"
 
 start on runlevel [2345]
-stop on runlevel [016]
+stop on runlevel [!2345]
 
 chdir /var/run
 
@@ -14,4 +14,5 @@ pre-start script
     chown cinder:root /var/lock/cinder
 end script
 
-exec su -s /bin/sh -c "exec cinder-volume --config-file=/etc/cinder/cinder.conf --log-file=/var/log/cinder/cinder-volume.log" cinder
+exec start-stop-daemon --start --chuid cinder --exec /usr/bin/cinder-volume \
+     -- --config-file=/etc/cinder/cinder.conf --log-file=/var/log/cinder/cinder-volume.log
-- 
2.45.2