summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2011-10-10 15:25:15 +0300
committerSimo Sorce <ssorce@redhat.com>2011-10-13 15:04:13 -0400
commit04ba21aaca9c376abab36cf75d764507a3b14802 (patch)
tree505d2b61d1731fe62a019e679df93ff6bf070893 /install
parent789b560a5786b02bd210f90c5b75b18b3ca609b3 (diff)
downloadfreeipa-04ba21aaca9c376abab36cf75d764507a3b14802.tar.gz
freeipa-04ba21aaca9c376abab36cf75d764507a3b14802.tar.xz
freeipa-04ba21aaca9c376abab36cf75d764507a3b14802.zip
Add support for systemd environments and use it to support Fedora 16
https://fedorahosted.org/freeipa/ticket/1192
Diffstat (limited to 'install')
-rwxr-xr-xinstall/tools/ipactl12
1 files changed, 11 insertions, 1 deletions
diff --git a/install/tools/ipactl b/install/tools/ipactl
index 4055cf91b..13e4b007a 100755
--- a/install/tools/ipactl
+++ b/install/tools/ipactl
@@ -24,7 +24,7 @@ try:
from ipaserver.install import service
from ipapython import services as ipaservices
from ipaserver.install.dsinstance import config_dirname, realm_to_serverid
- from ipaserver.install.installutils import is_ipa_configured
+ from ipaserver.install.installutils import is_ipa_configured, wait_for_open_ports, wait_for_open_socket
from ipapython import sysrestore
from ipapython import config
from ipalib import api, errors
@@ -32,6 +32,7 @@ try:
import logging
import ldap
import ldap.sasl
+ import ldapurl
import socket
except ImportError:
print >> sys.stderr, """\
@@ -117,6 +118,15 @@ def get_config():
attrs = ['cn', 'ipaConfigString']
try:
+ # systemd services are so fast that we come here before
+ # Directory Server actually starts listening. Wait for
+ # the socket/port be really available.
+ lurl = ldapurl.LDAPUrl(api.env.ldap_uri)
+ if lurl.urlscheme == 'ldapi':
+ wait_for_open_socket(lurl.hostport, timeout=6)
+ else:
+ (host,port) = lurl.hostport.split(':')
+ wait_for_open_ports(host, [port], timeout=6)
con = ldap.initialize(api.env.ldap_uri)
con.sasl_interactive_bind_s('', SASL_EXTERNAL)
res = con.search_st(base,