Example #1
0
    async def _start_collectd(self, **kwargs):
        async with (self.collectd_lock if kwargs.pop('_lock', True) else asyncnullcontext()):
            await self.middleware.call('etc.generate', 'collectd')

            if not await self.started('rrdcached'):
                # Let's ensure that before we start collectd, rrdcached is always running
                await self.start('rrdcached')

            await self._service("collectd-daemon", "restart", **kwargs)
Example #2
0
 async def restart(self, _lock=True):
     async with (self.lock if _lock else asyncnullcontext()):
         await self.stop(_lock=False)
         await self.start(_lock=False)
Example #3
0
 async def stop(self, _lock=True):
     async with (self.lock if _lock else asyncnullcontext()):
         await super().stop()
Example #4
0
 async def start(self, _lock=True):
     async with (self.lock if _lock else asyncnullcontext()):
         await self._ensure_rrdcached()
         await super().start()
Example #5
0
 async def import_disk_kernel_module_context_manager(self, fs_type):
     return asyncnullcontext()
Example #6
0
 async def _stop_collectd(self, **kwargs):
     async with (self.collectd_lock
                 if kwargs.pop('_lock', True) else asyncnullcontext()):
         await self._service("collectd-daemon", "stop", **kwargs)
Example #7
0
 async def _restart_freebsd(self, _lock=True):
     async with (self.lock if _lock else asyncnullcontext()):
         await self._stop_freebsd(_lock=False)
         await self._start_freebsd(_lock=False)
Example #8
0
 async def _stop_freebsd(self, _lock=True):
     async with (self.lock if _lock else asyncnullcontext()):
         await super()._stop_freebsd()
Example #9
0
 async def _start_freebsd(self, _lock=True):
     async with (self.lock if _lock else asyncnullcontext()):
         await self._freebsd_ensure_rrdcached()
         await super()._start_freebsd()