summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-nis-manage
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2011-09-13 00:11:54 +0300
committerMartin Kosek <mkosek@redhat.com>2011-09-13 11:15:50 +0200
commitbbbb550aaa13eb2ebdb113ff8738ed5c8f5277aa (patch)
tree6bff89c2c7bddc46ae710b8587aac6164c22ad76 /install/tools/ipa-nis-manage
parent45e379d5bf94170ccce16e6e2af8c5ccc55c826b (diff)
downloadfreeipa-bbbb550aaa13eb2ebdb113ff8738ed5c8f5277aa.tar.gz
freeipa-bbbb550aaa13eb2ebdb113ff8738ed5c8f5277aa.tar.xz
freeipa-bbbb550aaa13eb2ebdb113ff8738ed5c8f5277aa.zip
Convert installation tools to platform-independent access to system services
http://fedorahosted.org/freeipa/ticket/1605
Diffstat (limited to 'install/tools/ipa-nis-manage')
-rwxr-xr-xinstall/tools/ipa-nis-manage13
1 files changed, 8 insertions, 5 deletions
diff --git a/install/tools/ipa-nis-manage b/install/tools/ipa-nis-manage
index d875f96de..542736a8d 100755
--- a/install/tools/ipa-nis-manage
+++ b/install/tools/ipa-nis-manage
@@ -24,6 +24,7 @@ import os
try:
from optparse import OptionParser
from ipapython import ipautil, config
+ from ipapython import services as ipaservices
from ipaserver.install import installutils
from ipaserver.install.ldapupdate import LDAPUpdate, BadSyntax
from ipaserver.plugins.ldap2 import ldap2
@@ -143,15 +144,17 @@ def main():
# Enable either the portmap or rpcbind service
try:
- ipautil.run(["/sbin/chkconfig", "portmap", "on"])
- servicemsg = "portmap"
+ portmap = ipaservices.knownservices.portmap
+ portmap.enable()
+ servicemsg = portmap.service_name
except ipautil.CalledProcessError, cpe:
if cpe.returncode == 1:
try:
- ipautil.run(["/sbin/chkconfig", "rpcbind", "on"])
- servicemsg = "rpcbind"
+ rpcbind = ipaservices.knownservices.rpcbind
+ rpcbind.enable()
+ servicemsg = rpcbind.service_name
except ipautil.CalledProcessError, cpe:
- print "Unable to enable either portmap or rpcbind"
+ print "Unable to enable either %s or %s" % (portmap.service_name, rpcbind.service_name)
retval = 3
# The cn=config entry for the plugin may already exist but it