Do not use utils.running(), only works for upstart jobs.

This commit is contained in:
Adam Gandelman 2013-03-01 18:23:37 -08:00
parent dccddee22f
commit cba046cd55
3 changed files with 6 additions and 7 deletions

View File

@ -118,9 +118,8 @@ def ha_joined():
return
# rabbit node-name need to match on all nodes.
if utils.running('rabbitmq-server'):
utils.juju_log('INFO','Stopping rabbitmq-server.')
utils.stop('rabbitmq-server')
utils.juju_log('INFO','Stopping rabbitmq-server.')
utils.stop('rabbitmq-server')
with open('/etc/rabbitmq/rabbitmq.conf.d/node-name', 'wb') as out:
out.write('RABBITMQ_NODENAME=%s@localhost' % SERVICE_NAME)
@ -199,9 +198,8 @@ def ceph_changed():
else:
utils.juju_log('INFO',
'This is not the peer leader. Not configuring RBD.')
if utils.running('rabbitmq-server'):
utils.juju_log('INFO','Stopping rabbitmq-server.')
utils.stop('rabbitmq-server')
utils.juju_log('INFO','Stopping rabbitmq-server.')
utils.stop('rabbitmq-server')
# If 'ha' relation has been made before the 'ceph' relation
# it is important to make sure the ha-relation data is being

View File

@ -322,6 +322,7 @@ def start(*services):
def running(service):
# TODO: ensure compat. /w sysv init scripts.
try:
output = subprocess.check_output(['service', service, 'status'])
except subprocess.CalledProcessError:

View File

@ -1 +1 @@
75
76