summaryrefslogtreecommitdiffstats
path: root/meta-openstack
diff options
context:
space:
mode:
authorKeith Holman <Keith.Holman@windriver.com>2014-05-26 09:13:06 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-05-26 11:34:25 -0400
commit5bb6ced1ddfa65bc0c3be688a93a1883dd751b08 (patch)
treef592d40e18141bd0d05934868bc0e5ad6cbf27bd /meta-openstack
parentc2566d477ccd65c57922cc791f199f305cbc918c (diff)
downloadmeta-cloud-services-5bb6ced1ddfa65bc0c3be688a93a1883dd751b08.tar.gz
tgt: prevent service from being started multiple times
Using the /etc/init.d/tgtd script, allows the service be started multiple times, but only the last instance can be stopped using the script. This fix ensures that the service isn't running before attempting to start the service multiple times. Signed-off-by: Keith Holman <Keith.Holman@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack')
-rw-r--r--meta-openstack/recipes-support/tgt/files/tgtd.init9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta-openstack/recipes-support/tgt/files/tgtd.init b/meta-openstack/recipes-support/tgt/files/tgtd.init
index 8c07926..52d98c3 100644
--- a/meta-openstack/recipes-support/tgt/files/tgtd.init
+++ b/meta-openstack/recipes-support/tgt/files/tgtd.init
@@ -17,6 +17,15 @@ TGTD_CONFIG=/etc/tgt/targets.conf
17start () 17start ()
18{ 18{
19 echo -n "Starting $DESC..." 19 echo -n "Starting $DESC..."
20
21 # Ensure service isn't running
22 tgt-admin -s >/dev/null 2>&1
23 RETVAL=$?
24 if [ "$RETVAL" -ne 107 ] ; then
25 echo "$DESC is already running."
26 exit 1
27 fi
28
20 # Start tgtd first 29 # Start tgtd first
21 $DAEMON &>/dev/null 30 $DAEMON &>/dev/null
22 RETVAL=$? 31 RETVAL=$?