summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-install
diff options
context:
space:
mode:
authorrcritten@redhat.com <rcritten@redhat.com>2007-10-03 17:37:13 -0400
committerrcritten@redhat.com <rcritten@redhat.com>2007-10-03 17:37:13 -0400
commit53e872fb72098a8c504613c0946cecfe31d5fab7 (patch)
treeaa11252b777403e3d9cad75699ae24d900d069d8 /ipa-server/ipa-install
parent1cef67e2e16ec137a1d04f9f4f99694ed36e3d28 (diff)
downloadfreeipa-53e872fb72098a8c504613c0946cecfe31d5fab7.tar.gz
freeipa-53e872fb72098a8c504613c0946cecfe31d5fab7.tar.xz
freeipa-53e872fb72098a8c504613c0946cecfe31d5fab7.zip
Try to catch more error conditions during installation
Modify the way we detect SELinux to use selinuxenabled instead of using a try/except. Handle SASL/GSSAPI authentication failures when getting a connection
Diffstat (limited to 'ipa-server/ipa-install')
-rw-r--r--ipa-server/ipa-install/ipa-server-install53
1 files changed, 32 insertions, 21 deletions
diff --git a/ipa-server/ipa-install/ipa-server-install b/ipa-server/ipa-install/ipa-server-install
index fd2071ad8..0c2080187 100644
--- a/ipa-server/ipa-install/ipa-server-install
+++ b/ipa-server/ipa-install/ipa-server-install
@@ -34,6 +34,7 @@ import socket
import logging
import pwd
import getpass
+import subprocess
import signal
import shutil
import glob
@@ -430,36 +431,46 @@ def main():
ds.restart()
krb.restart()
- # Allow apache to connect to the turbogears web gui
try:
- run(["/usr/sbin/setsebool", "-P", "httpd_can_network_connect", "true"])
- except:
- # SELinux may be disabled
- pass
+ selinux=0
+ try:
+ if (os.path.exists('/usr/sbin/selinuxenabled')):
+ run(["/usr/sbin/selinuxenabled"])
+ selinux=1
+ except subprocess.CalledProcessError, e:
+ # selinuxenabled returns 1 if not enabled
+ pass
+
+ if selinux:
+ # Allow apache to connect to the turbogears web gui
+ run(["/usr/sbin/setsebool", "-P", "httpd_can_network_connect", "true"])
- # Start the web gui
- run(["/sbin/service", "ipa-webgui", "start"])
+ # Start the web gui
+ run(["/sbin/service", "ipa-webgui", "start"])
- # Set the web gui to start on boot
- run(["/sbin/chkconfig", "ipa-webgui", "on"])
+ # Set the web gui to start on boot
+ run(["/sbin/chkconfig", "ipa-webgui", "on"])
- # Restart apache
- run(["/sbin/service", "httpd", "restart"])
+ # Restart apache
+ run(["/sbin/service", "httpd", "restart"])
- # Set apache to start on boot
- run(["/sbin/chkconfig", "httpd", "on"])
+ # Set apache to start on boot
+ run(["/sbin/chkconfig", "httpd", "on"])
- # Set fedora-ds to start on boot
- run(["/sbin/chkconfig", "dirsrv", "on"])
+ # Set fedora-ds to start on boot
+ run(["/sbin/chkconfig", "dirsrv", "on"])
- # Set the KDC to start on boot
- run(["/sbin/chkconfig", "krb5kdc", "on"])
+ # Set the KDC to start on boot
+ run(["/sbin/chkconfig", "krb5kdc", "on"])
- # Set the Kpasswd to start on boot
- run(["/sbin/chkconfig", "ipa-kpasswd", "on"])
+ # Set the Kpasswd to start on boot
+ run(["/sbin/chkconfig", "ipa-kpasswd", "on"])
- # Start Kpasswd
- run(["/sbin/service", "ipa-kpasswd", "start"])
+ # Start Kpasswd
+ run(["/sbin/service", "ipa-kpasswd", "start"])
+ except subprocess.CalledProcessError, e:
+ print "Installation failed:", e
+ return 1
# Set the admin user kerberos password
ds.change_admin_password(admin_password)