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)
async def restart(self, _lock=True): async with (self.lock if _lock else asyncnullcontext()): await self.stop(_lock=False) await self.start(_lock=False)
async def stop(self, _lock=True): async with (self.lock if _lock else asyncnullcontext()): await super().stop()
async def start(self, _lock=True): async with (self.lock if _lock else asyncnullcontext()): await self._ensure_rrdcached() await super().start()
async def import_disk_kernel_module_context_manager(self, fs_type): return asyncnullcontext()
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)
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)
async def _stop_freebsd(self, _lock=True): async with (self.lock if _lock else asyncnullcontext()): await super()._stop_freebsd()
async def _start_freebsd(self, _lock=True): async with (self.lock if _lock else asyncnullcontext()): await self._freebsd_ensure_rrdcached() await super()._start_freebsd()