[Ovirt-devel] [PATCH] Fix so libvirt does not start default network interface on developer/bundled

Alan Pevec apevec at redhat.com
Tue May 27 01:00:58 UTC 2008


Here is modified Perry's patch:
- use virsh to remove 'default' network
- remove ovirt-fix-ipa, IPA is now at /ipa
- use new ovirt-management repo URL
- minor edits: Ovirt -> oVirt, use ${OVIRT_DIR}

diff --git a/wui-appliance/common-install.ks b/wui-appliance/common-install.ks
index 5a590b5..e2fa902 100644
--- a/wui-appliance/common-install.ks
+++ b/wui-appliance/common-install.ks
@@ -5,7 +5,7 @@ rootpw --iscrypted Xa8QeYfWrtscM
 firewall --disabled
 authconfig --enableshadow --enablemd5
 selinux --disabled
-services --disabled=iptables,yum-updatesd,libvirtd,bluetooth,cups,gpm,pcscd,NetworkManager,NetworkManagerDispatcher --enabled=ntpd,httpd,postgresql,ovirt-wui,tgtd,nfs,collectd,network
+services --disabled=libvirtd,postgresql,iptables,yum-updatesd,bluetooth,cups,gpm,pcscd,NetworkManager,NetworkManagerDispatcher --enabled=network,tgtd,nfs
 timezone --utc UTC
 text
 
diff --git a/wui-appliance/common-post.ks b/wui-appliance/common-post.ks
index 67a885b..a4e0bd2 100644
--- a/wui-appliance/common-post.ks
+++ b/wui-appliance/common-post.ks
@@ -25,7 +25,7 @@ cp /etc/issue /etc/issue.net
 cat > /etc/init.d/ovirt-wui-first-run << \EOF
 #!/bin/bash
 #
-# ovirt-wui-first-run First run configuration for Ovirt WUI appliance
+# ovirt-wui-first-run First run configuration for oVirt WUI appliance
 #
 # chkconfig: 3 96 01
 # description: ovirt wui appliance first run configuration
@@ -65,7 +65,7 @@ chkconfig ovirt-wui-first-run on
 cat > /etc/yum.repos.d/ovirt-management.repo << \EOF
 [ovirt-management]
 name=ovirt-management
-baseurl=http://ovirt.et.redhat.com/repos/ovirt-management-repo/$basearch/
+baseurl=http://ovirt.org/repos/ovirt/9/$basearch/
 enabled=1
 gpgcheck=0
 EOF
diff --git a/wui-appliance/wui-devel-x86_64.ks b/wui-appliance/wui-devel-x86_64.ks
index 1294c89..1ab990f 100644
--- a/wui-appliance/wui-devel-x86_64.ks
+++ b/wui-appliance/wui-devel-x86_64.ks
@@ -110,7 +110,7 @@ sed -e "s, at cron_file@,$cron_file," \
    > $first_run_file << \EOF
 #!/bin/bash
 #
-# ovirt-wui-dev-first-run First run configuration for Ovirt WUI Dev appliance
+# ovirt-wui-dev-first-run First run configuration for oVirt WUI Dev appliance
 #
 # chkconfig: 3 95 01
 # description: ovirt dev wui appliance first run configuration
@@ -160,7 +160,7 @@ chkconfig ovirt-wui-dev-first-run on
 cat > /etc/init.d/ovirt-wui-dev << \EOF
 #!/bin/bash
 #
-# ovirt-wui-dev Ovirt WUI Dev appliance service
+# ovirt-wui-dev oVirt WUI Dev appliance service
 #
 # chkconfig: 3 60 40 
 # description: ovirt dev wui appliance service
diff --git a/wui/scripts/ovirt-fix-ipa b/wui/scripts/ovirt-fix-ipa
deleted file mode 100755
index 9e4aa14..0000000
--- a/wui/scripts/ovirt-fix-ipa
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-
-import os, string, re
-
-ipaConfName = '/etc/httpd/conf.d/ipa.conf'
-ipaRewriteConfName = '/etc/httpd/conf.d/ipa-rewrite.conf'
-
-# make sure we skip this on subsequent runs of this script
-if string.find(file(ipaConfName, 'rb').read(), '<VirtualHost *:8089>') < 0:
-    ipaConf = open(ipaConfName, 'r')
-    ipaText = ipaConf.readlines()
-    ipaConf.close()
-
-    ipaConf2 = open(ipaConfName, 'w')
-    print >>ipaConf2, "Listen 8089"
-    print >>ipaConf2, "NameVirtualHost *:8089"
-    print >>ipaConf2, "<VirtualHost *:8089>"
-    for line in ipaText:
-        ipaConf2.write(line)
-    print >>ipaConf2, "</VirtualHost>"
-    ipaConf2.close()
-
-if os.path.isfile(ipaRewriteConfName):
-    os.remove(ipaRewriteConfName)
-    ipaRewriteConf = open(ipaRewriteConfName, 'w')
-    print >>ipaRewriteConf, ""
-    ipaRewriteConf.close()
-
diff --git a/wui/scripts/ovirt-wui-install b/wui/scripts/ovirt-wui-install
index 41b4f3d..d1b8452 100755
--- a/wui/scripts/ovirt-wui-install
+++ b/wui/scripts/ovirt-wui-install
@@ -13,9 +13,16 @@ STEP_FILE=/etc/ntp/step-tickers
 SASL_FILE=/etc/sasl2/libvirt.conf
 LDAP_CFG=${OVIRT_DIR}/config/ldap.yml
 
-OVIRT_SVCS="ovirt-host-browser ovirt-host-status \
-            ovirt-taskomatic ovirt-host-keyadd ovirt-mongrel-rails"
-ENABLE_SVCS="ntpd httpd postgresql libvirtd"
+OVIRT_SVCS="ovirt-host-browser ovirt-host-keyadd ovirt-host-status \
+            ovirt-mongrel-rails ovirt-taskomatic"
+ENABLE_SVCS="ntpd httpd postgresql libvirtd collectd"
+
+# This checks to see if we're running on a bundled/developer install.
+# If we are, set PROD_INST to false
+PROD_INST=true
+if [ "$(hostname)" == "management.priv.ovirt.org" ]; then
+    PROD_INST=false
+fi
 
 usage() {
     echo "usage: $0 [-p password]"
@@ -27,13 +34,7 @@ usage() {
 find_srv() {
     local dnsreply
     
-    # This checks to see if we're running on a bundled/developer install.  
-    # If so, the server queried is localhost instead of using resolv.conf.  
-    if [ "$(hostname)" == "management.priv.ovirt.org" ]; then
-        local server_flag=@localhost
-    fi
-
-    dnsreply=$(dig $server_flag +short -t srv _$1._$2.$(dnsdomainname))
+    dnsreply=$(dig +short -t srv _$1._$2.$(dnsdomainname))
     if [ $? -eq 0 ]; then
         set _ $dnsreply; shift
         SRV_HOST=$4; SRV_PORT=$3
@@ -118,6 +119,15 @@ if [ `egrep -c '^mech_list: gssapi' $SASL_FILE` -eq 0 ]; then
     echo "mech_list: gssapi" >> $SASL_FILE
 fi
 
+# if we are developer/bundled install, remove default network
+# so dnsmasq from libvirt doesn't interfere with the dev/bundled
+# dnsmasq
+if [[ "$PROD_INST" == "false" ]]; then
+    service libvirtd status > /dev/null 2&>1 || service libvirtd start > /dev/null 2>&1
+    virsh net-destroy default
+    virsh net-undefine default
+fi
+
 service postgresql stop > /dev/null 2>&1
 service postgresql initdb > /dev/null 2>&1
 echo "local all all trust" > /var/lib/pgsql/data/pg_hba.conf 
@@ -162,20 +172,12 @@ cd -
 ${OVIRT_DIR}/script/grant_admin_privileges admin
 [ $? != 0 ] && echo "Failed to grant admin privileges" && exit 1
 
-if [ -f /usr/share/ovirt-wui/ovirtadmin.tab ]; then
+if [ -f ${OVIRT_DIR}/ovirtadmin.tab ]; then
     ${OVIRT_DIR}/script/grant_admin_privileges ovirtadmin
     [ $? != 0 ] && echo "Failed to grant ovirtadmin privileges" && exit 1
 fi
 
-/usr/bin/ovirt-add-host $(hostname) ${OVIRT_DIR}/ovirt.keytab
-
-# This is temporary until we get a version of FreeIPA that runs under /ipa
-# instead of as root
-if [ -f /etc/httpd/conf.d/ipa.conf ]; then
-    /usr/bin/ovirt-fix-ipa
-    service httpd restart
-    service ipa_webgui restart
-fi
+ovirt-add-host $(hostname) ${OVIRT_DIR}/ovirt.keytab
 
 for svc in $OVIRT_SVCS $ENABLE_SVCS; do
     service $svc start




More information about the ovirt-devel mailing list