Skip to content

Commit

Permalink
Stop TrueCommand connection on BACKUP node
Browse files Browse the repository at this point in the history
  • Loading branch information
themylogin committed May 13, 2021
1 parent befc570 commit ab8a463
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ def carp_backup(self, fobj, ifname, vhid, event, user_override):
run('/usr/sbin/service watchdogd quietstart')
self.run_call('service.stop', 'smartd', {'ha_propagate': False})
self.run_call('service.stop', 'collectd', {'ha_propagate': False})
self.run_call('truecommand.stop_truecommand_service')
self.run_call('jail.stop_on_shutdown')
for vm in (self.run_call('vm.query', [['status.state', '=', 'RUNNING']]) or []):
self.run_call('vm.poweroff', vm['id'], True)
Expand Down
6 changes: 5 additions & 1 deletion src/middlewared/middlewared/plugins/truecommand/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

async def _event_system(middleware, event_type, args):
if args['id'] == 'ready':
if await middleware.call('failover.licensed'):
return

await middleware.call('truecommand.start_truecommand_service')


Expand All @@ -20,4 +23,5 @@ async def setup(middleware):

middleware.event_subscribe('system', _event_system)
if await middleware.call('system.ready'):
asyncio.ensure_future(middleware.call('truecommand.start_truecommand_service'))
if not await middleware.call('failover.licensed'):
asyncio.ensure_future(middleware.call('truecommand.start_truecommand_service'))

0 comments on commit ab8a463

Please sign in to comment.