From 895b2e2b4339f1b9edc2bc995e7548ac118ea5a1 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 1 Nov 2012 14:23:38 -0400 Subject: Revert "Save service name on service startup" This reverts commit 1ef651e7f9f5f940051dc470385aa08eefcd60af. This was an olde version of the patch, next commit will put in the acked version. --- ipapython/platform/base.py | 23 ----------------------- ipapython/platform/redhat.py | 1 - ipapython/platform/systemd.py | 1 - 3 files changed, 25 deletions(-) (limited to 'ipapython/platform') diff --git a/ipapython/platform/base.py b/ipapython/platform/base.py index 1101b5cd..2d39d216 100644 --- a/ipapython/platform/base.py +++ b/ipapython/platform/base.py @@ -17,8 +17,6 @@ # along with this program. If not, see . from ipalib.plugable import MagicDict -import json -import os # 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 @@ -42,8 +40,6 @@ wellknownports = { 'pki-tomcatd': [8080, 8443], # used if the incoming instance name is blank } -SVC_LIST_FILE = "/var/run/ipa/services.list" - class AuthConfig(object): """ AuthConfig class implements system-independent interface to configure @@ -137,25 +133,6 @@ class PlatformService(object): self.service_name = service_name def start(self, instance_name="", capture_output=True, wait=True): - """ - When a service is started record the fact in a special file. - This allows ipactl stop to always stop all services that have - been started via ipa tools - """ - svc_list = [] - try: - f = open(SVC_LIST_FILE, 'r') - svc_list = json.load(f) - except Exception: - # not fatal, may be the first service - pass - - svc_list.append(self.service_name) - - f = open(SVC_LIST_FILE, 'w') - json.dump(svc_list, f) - f.flush() - f.close() return def stop(self, instance_name="", capture_output=True): diff --git a/ipapython/platform/redhat.py b/ipapython/platform/redhat.py index cd127773..3551c284 100644 --- a/ipapython/platform/redhat.py +++ b/ipapython/platform/redhat.py @@ -71,7 +71,6 @@ class RedHatService(base.PlatformService): ipautil.run(["/sbin/service", self.service_name, "start", instance_name], capture_output=capture_output) if wait and self.is_running(instance_name): self.__wait_for_open_ports(instance_name) - super(RedHatService, self).start(instance_name) def restart(self, instance_name="", capture_output=True, wait=True): ipautil.run(["/sbin/service", self.service_name, "restart", instance_name], capture_output=capture_output) diff --git a/ipapython/platform/systemd.py b/ipapython/platform/systemd.py index 63414058..6c25a79b 100644 --- a/ipapython/platform/systemd.py +++ b/ipapython/platform/systemd.py @@ -96,7 +96,6 @@ class SystemdService(base.PlatformService): ipautil.run(["/bin/systemctl", "start", self.service_instance(instance_name)], capture_output=capture_output) if wait and self.is_running(instance_name): self.__wait_for_open_ports(self.service_instance(instance_name)) - super(SystemdService, self).start(instance_name) def restart(self, instance_name="", capture_output=True, wait=True): # Restart command is broken before systemd-36-3.fc16 -- cgit