Revert "Save service name on service startup"

This reverts commit 1ef651e7f9.

This was an olde version of the patch, next commit will put in the acked
version.
This commit is contained in:
Simo Sorce
2012-11-01 14:23:38 -04:00
parent 1c7261773b
commit 895b2e2b43
4 changed files with 0 additions and 29 deletions

View File

@@ -17,8 +17,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
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):

View File

@@ -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)

View File

@@ -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

View File

@@ -51,8 +51,4 @@ backup_and_replace_hostname = backup_and_replace_hostname_default
def check_selinux_status():
return
from ipapython.platform.base import SVC_LIST_FILE
def get_svc_list_file():
return SVC_LIST_FILE
from ipapython.platform.SUPPORTED_PLATFORM import *