diff --git a/ipaplatform/base/services.py b/ipaplatform/base/services.py index 73687982d..13168585c 100644 --- a/ipaplatform/base/services.py +++ b/ipaplatform/base/services.py @@ -29,6 +29,7 @@ import os import json import time import collections +import logging import warnings import six @@ -36,6 +37,9 @@ import six from ipapython import ipautil from ipaplatform.paths import paths + +logger = logging.getLogger(__name__) + # Canonical names of services as IPA wants to see them. As we need to have # *some* naming, set them as in Red Hat distributions. Actual implementation # should make them available through knownservices. and take care of @@ -289,6 +293,7 @@ class SystemdService(PlatformService): super(SystemdService, self).stop( instance_name, update_service_list=update_service_list) + logger.debug('Stop of %s complete', instance) def start(self, instance_name="", capture_output=True, wait=True): ipautil.run([paths.SYSTEMCTL, "start", @@ -303,6 +308,8 @@ class SystemdService(PlatformService): super(SystemdService, self).start( instance_name, update_service_list=update_service_list) + logger.debug('Start of %s complete', + self.service_instance(instance_name)) def _restart_base(self, instance_name, operation, capture_output=True, wait=False): @@ -313,6 +320,8 @@ class SystemdService(PlatformService): if wait and self.is_running(instance_name): self.wait_for_open_ports(self.service_instance(instance_name)) + logger.debug('Restart of %s complete', + self.service_instance(instance_name)) def reload_or_restart(self, instance_name="", capture_output=True, wait=True):