Enable the portmap or rpcbind service if the NIS service is enabled

This commit is contained in:
Rob Crittenden 2009-05-19 15:19:44 -04:00 committed by Jason Gerard DeRose
parent fe012f4ff2
commit 7da22cf8c7

View File

@ -80,6 +80,7 @@ def main():
retval = 0 retval = 0
loglevel = logging.NOTSET loglevel = logging.NOTSET
files=['/usr/share/ipa/nis.uldif'] files=['/usr/share/ipa/nis.uldif']
servicemsg = ""
options, args = parse_options() options, args = parse_options()
if options.debug: if options.debug:
@ -120,6 +121,19 @@ def main():
print "%s" % e[0]['desc'] print "%s" % e[0]['desc']
retval = 1 retval = 1
# Enable either the portmap or rpcbind service
try:
ipautil.run(["/sbin/chkconfig", "portmap", "on"])
servicemsg = "portmap"
except ipautil.CalledProcessError, e:
if e.returncode == 1:
try:
ipautil.run(["/sbin/chkconfig", "rpcbind", "on"])
servicemsg = "rpcbind"
except ipautil.CalledProcessError, e:
print "Unable to enable either portmap or rpcbind"
retval = 3
if entry is None: if entry is None:
print "Enabling plugin" print "Enabling plugin"
@ -157,6 +171,9 @@ def main():
if retval == 0: if retval == 0:
print "This setting will not take effect until you restart Directory Server." print "This setting will not take effect until you restart Directory Server."
if args[0] == "enable":
print "The %s service may need to be started." % servicemsg
finally: finally:
if conn: if conn:
conn.unbind() conn.unbind()