(self, services: str | list[str])
| 717 | self.enable_service('fstrim.timer') |
| 718 | |
| 719 | def enable_service(self, services: str | list[str]) -> None: |
| 720 | if isinstance(services, str): |
| 721 | services = [services] |
| 722 | |
| 723 | for service in services: |
| 724 | info(f'Enabling service {service}') |
| 725 | |
| 726 | try: |
| 727 | SysCommand(f'systemctl --root={self.target} enable {service}') |
| 728 | except SysCallError as err: |
| 729 | raise ServiceException(f'Unable to start service {service}: {err}') |
| 730 | |
| 731 | for plugin in plugins.values(): |
| 732 | if hasattr(plugin, 'on_service'): |
| 733 | plugin.on_service(service) |
| 734 | |
| 735 | def disable_service(self, services_disable: str | list[str]) -> None: |
| 736 | if isinstance(services_disable, str): |
no test coverage detected