From 3eb8ae42ee0a988807024250f44dd0507a49fe8f Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 7 Sep 2010 18:50:42 -0700 Subject: [PATCH] merge domr patch kvm and patch xenserver --- build/build-cloud.xml | 39 +-- build/package.xml | 12 +- patches/kvm/etc/init.d/seteth1 | 223 ------------------ patches/kvm/etc/sysconfig/iptables | 33 --- patches/kvm/etc/sysconfig/iptables-config | 48 ---- patches/kvm/etc/sysconfig/iptables-domp | 18 -- patches/kvm/etc/sysconfig/iptables-domr | 23 -- patches/kvm/etc/sysctl.conf | 27 --- patches/kvm/root/edithosts.sh | 51 ---- patches/{kvm => systemvm}/etc/dnsmasq.conf | 8 +- .../{kvm => systemvm}/etc/haproxy/haproxy.cfg | 0 patches/{kvm => systemvm}/etc/hosts | 0 .../etc/init.d/domr_webserver | 0 .../etc/init.d/postinit | 9 +- .../etc/init.d/seteth1 | 22 +- patches/{kvm => systemvm}/etc/init.d/vmops | 0 patches/{kvm => systemvm}/etc/rc.local | 0 patches/{kvm => systemvm}/etc/ssh/sshd_config | 0 .../etc/sysconfig/iptables-consoleproxy | 0 .../etc/sysconfig/iptables-domr | 0 .../etc/sysconfig/iptables-secstorage | 0 .../{xenserver => systemvm}/etc/sysctl.conf | 0 .../root/.ssh/authorized_keys | 0 .../root/clearUsageRules.sh | 0 .../{xenserver => systemvm}/root/edithosts.sh | 0 .../{xenserver => systemvm}/root/firewall.sh | 0 .../root/loadbalancer.sh | 0 .../root/patchsystemvm.sh | 0 patches/{kvm => systemvm}/root/reconfigLB.sh | 0 .../{kvm => systemvm}/root/run_domr_webserver | 0 .../root/send_password_to_domu.sh | 0 .../var/www/html/latest/.htaccess | 0 .../var/www/html/metadata/.htaccess | 0 .../var/www/html/userdata/.htaccess | 0 .../xenserver/etc/sysconfig/iptables-config | 48 ---- .../storage/LocalStoragePoolListener.java | 1 + 36 files changed, 46 insertions(+), 516 deletions(-) delete mode 100755 patches/kvm/etc/init.d/seteth1 delete mode 100755 patches/kvm/etc/sysconfig/iptables delete mode 100644 patches/kvm/etc/sysconfig/iptables-config delete mode 100755 patches/kvm/etc/sysconfig/iptables-domp delete mode 100755 patches/kvm/etc/sysconfig/iptables-domr delete mode 100755 patches/kvm/etc/sysctl.conf delete mode 100755 patches/kvm/root/edithosts.sh rename patches/{kvm => systemvm}/etc/dnsmasq.conf (99%) rename patches/{kvm => systemvm}/etc/haproxy/haproxy.cfg (100%) rename patches/{kvm => systemvm}/etc/hosts (100%) rename patches/{kvm => systemvm}/etc/init.d/domr_webserver (100%) rename patches/{xenserver => systemvm}/etc/init.d/postinit (95%) rename patches/{xenserver => systemvm}/etc/init.d/seteth1 (94%) rename patches/{kvm => systemvm}/etc/init.d/vmops (100%) rename patches/{kvm => systemvm}/etc/rc.local (100%) rename patches/{kvm => systemvm}/etc/ssh/sshd_config (100%) rename patches/{xenserver => systemvm}/etc/sysconfig/iptables-consoleproxy (100%) rename patches/{xenserver => systemvm}/etc/sysconfig/iptables-domr (100%) rename patches/{xenserver => systemvm}/etc/sysconfig/iptables-secstorage (100%) rename patches/{xenserver => systemvm}/etc/sysctl.conf (100%) rename patches/{xenserver => systemvm}/root/.ssh/authorized_keys (100%) rename patches/{xenserver => systemvm}/root/clearUsageRules.sh (100%) rename patches/{xenserver => systemvm}/root/edithosts.sh (100%) rename patches/{xenserver => systemvm}/root/firewall.sh (100%) rename patches/{xenserver => systemvm}/root/loadbalancer.sh (100%) rename patches/{xenserver => systemvm}/root/patchsystemvm.sh (100%) rename patches/{kvm => systemvm}/root/reconfigLB.sh (100%) rename patches/{kvm => systemvm}/root/run_domr_webserver (100%) rename patches/{kvm => systemvm}/root/send_password_to_domu.sh (100%) rename patches/{shared => systemvm}/var/www/html/latest/.htaccess (100%) rename patches/{shared => systemvm}/var/www/html/metadata/.htaccess (100%) rename patches/{shared => systemvm}/var/www/html/userdata/.htaccess (100%) delete mode 100644 patches/xenserver/etc/sysconfig/iptables-config diff --git a/build/build-cloud.xml b/build/build-cloud.xml index ebdefbb90b0..45820a0df5c 100755 --- a/build/build-cloud.xml +++ b/build/build-cloud.xml @@ -107,9 +107,6 @@ - - - @@ -518,40 +515,18 @@ - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - + + diff --git a/build/package.xml b/build/package.xml index 8ef81bef0d9..5e4682461a7 100755 --- a/build/package.xml +++ b/build/package.xml @@ -23,7 +23,6 @@ - @@ -92,9 +91,9 @@ - + - + @@ -103,15 +102,14 @@ - + - - + @@ -136,7 +134,7 @@ - + diff --git a/patches/kvm/etc/init.d/seteth1 b/patches/kvm/etc/init.d/seteth1 deleted file mode 100755 index 0dd61a77f9b..00000000000 --- a/patches/kvm/etc/init.d/seteth1 +++ /dev/null @@ -1,223 +0,0 @@ - - - -#! /bin/bash -# chkconfig: 35 09 90 -# description: pre-boot configuration using boot line parameters -# This file exists in /etc/init.d/ - -replace_in_file() { - local filename=$1 - local keyname=$2 - local value=$3 - sed -i /$keyname=/d $filename - echo "$keyname=$value" >> $filename - return $? -} - -setup_interface() { - local intfnum=$1 - local ip=$2 - local mask=$3 - - cfg=/etc/sysconfig/network-scripts/ifcfg-eth${intfnum} - replace_in_file ${cfg} IPADDR ${ip} - replace_in_file ${cfg} NETMASK ${mask} - replace_in_file ${cfg} BOOTPROTO STATIC - if [ "$ip" == "0.0.0.0" ] - then - replace_in_file ${cfg} ONBOOT No - else - replace_in_file ${cfg} ONBOOT Yes - fi -} - -setup_common() { - setup_interface "0" $ETH0_IP $ETH0_MASK - setup_interface "1" $ETH1_IP $ETH1_MASK - setup_interface "2" $ETH2_IP $ETH2_MASK - - replace_in_file /etc/sysconfig/network GATEWAY $GW - replace_in_file /etc/sysconfig/network HOSTNAME $NAME - echo "NOZEROCONF=yes" >> /etc/sysconfig/network - hostname $NAME - - #Nameserver - if [ -n "$NS1" ] - then - echo "nameserver $NS1" > /etc/dnsmasq-resolv.conf - echo "nameserver $NS1" > /etc/resolv.conf - fi - - if [ -n "$NS2" ] - then - echo "nameserver $NS2" >> /etc/dnsmasq-resolv.conf - echo "nameserver $NS2" >> /etc/resolv.conf - fi - if [[ -n "$MGMTNET" && -n "$LOCAL_GW" ]] - then - echo "$MGMTNET via $LOCAL_GW dev eth1" > /etc/sysconfig/network-scripts/route-eth1 - fi -} - -setup_router() { - setup_common - [ -z $DHCP_RANGE ] && DHCP_RANGE=$ETH0_IP - if [ -n "$DOMAIN" ] - then - #send domain name to dhcp clients - sed -i s/[#]*dhcp-option=15.*$/dhcp-option=15,\"$DOMAIN\"/ /etc/dnsmasq.conf - #DNS server will append $DOMAIN to local queries - sed -r -i s/^[#]?domain=.*$/domain=$DOMAIN/ /etc/dnsmasq.conf - #answer all local domain queries - sed -i -e "s/^[#]*local=.*$/local=\/$DOMAIN\//" /etc/dnsmasq.conf - fi - sed -i -e "s/^dhcp-range=.*$/dhcp-range=$DHCP_RANGE,static/" /etc/dnsmasq.conf - sed -i -e "s/^[#]*listen-address=.*$/listen-address=$ETH0_IP/" /etc/dnsmasq.conf - sed -i /gateway/d /etc/hosts - echo "$ETH0_IP $NAME" >> /etc/hosts - [ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*$/Listen $ETH0_IP:80/" /etc/httpd/conf/httpd.conf - [ -f /etc/httpd/conf.d/ssl.conf ] && mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak - [ -f /etc/ssh/sshd_config ] && sed -i -e "s/^[#]*ListenAddress.*$/ListenAddress $ETH1_IP/" /etc/ssh/sshd_config -} - -setup_dhcpsrvr() { - setup_common - [ -z $DHCP_RANGE ] && DHCP_RANGE=$ETH0_IP - if [ -n "$DOMAIN" ] - then - #send domain name to dhcp clients - sed -i s/[#]*dhcp-option=15.*$/dhcp-option=15,\"$DOMAIN\"/ /etc/dnsmasq.conf - #DNS server will append $DOMAIN to local queries - sed -r -i s/^[#]?domain=.*$/domain=$DOMAIN/ /etc/dnsmasq.conf - #answer all local domain queries - sed -i -e "s/^[#]*local=.*$/local=\/$DOMAIN\//" /etc/dnsmasq.conf - else - #delete domain option - sed -i /^dhcp-option=15.*$/d /etc/dnsmasq.conf - sed -i /^domain=.*$/d /etc/dnsmasq.conf - sed -i -e "/^local=.*$/d" /etc/dnsmasq.conf - fi - sed -i -e "s/^dhcp-range=.*$/dhcp-range=$DHCP_RANGE,static/" /etc/dnsmasq.conf - sed -i -e "s/^[#]*dhcp-option=option:router.*$/dhcp-option=option:router,$GW/" /etc/dnsmasq.conf - echo "dhcp-option=6,$NS1,$NS2" >> /etc/dnsmasq.conf - sed -i /gateway/d /etc/hosts - echo "$ETH0_IP $NAME" >> /etc/hosts - [ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*$/Listen $ETH0_IP:80/" /etc/httpd/conf/httpd.conf - [ -f /etc/httpd/conf.d/ssl.conf ] && mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak -} - -setup_secstorage() { - setup_common - sed -i /gateway/d /etc/hosts - public_ip=$ETH2_IP - [ "$ETH2_IP" == "0.0.0.0" ] && public_ip=$ETH1_IP - echo "$public_ip $NAME" >> /etc/hosts - [ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*:80$/Listen $public_ip:80/" /etc/httpd/conf/httpd.conf - [ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*:443$/Listen $public_ip:443/" /etc/httpd/conf/httpd.conf -} - -setup_console_proxy() { - setup_common - public_ip=$ETH2_IP - [ "$ETH2_IP" == "0.0.0.0" ] && public_ip=$ETH1_IP - sed -i /gateway/d /etc/hosts - echo "$public_ip $NAME" >> /etc/hosts -} - -if [ -f /mnt/cmdline ] -then - CMDLINE=$(cat /mnt/cmdline) -else - CMDLINE=$(cat /proc/cmdline) -fi - -TYPE="router" - -for i in $CMDLINE - do - # search for foo=bar pattern and cut out foo - KEY=$(echo $i | cut -d= -f1) - VALUE=$(echo $i | cut -d= -f2) - case $KEY in - eth0ip) - ETH0_IP=$VALUE - ;; - eth1ip) - ETH1_IP=$VALUE - ;; - eth2ip) - ETH2_IP=$VALUE - ;; - gateway) - GW=$VALUE - ;; - eth0mask) - ETH0_MASK=$VALUE - ;; - eth1mask) - ETH1_MASK=$VALUE - ;; - eth2mask) - ETH2_MASK=$VALUE - ;; - dns1) - NS1=$VALUE - ;; - dns2) - NS2=$VALUE - ;; - domain) - DOMAIN=$VALUE - ;; - mgmtcidr) - MGMTNET=$VALUE - ;; - localgw) - LOCAL_GW=$VALUE - ;; - template) - TEMPLATE=$VALUE - ;; - name) - NAME=$VALUE - ;; - dhcprange) - DHCP_RANGE=$(echo $VALUE | tr ':' ',') - ;; - type) - TYPE=$VALUE - ;; - esac -done - -case $TYPE in - router) - [ "$NAME" == "" ] && NAME=router - setup_router - ;; - dhcpsrvr) - [ "$NAME" == "" ] && NAME=dhcpsrvr - setup_dhcpsrvr - ;; - secstorage) - [ "$NAME" == "" ] && NAME=secstorage - setup_secstorage; - ;; - consoleproxy) - [ "$NAME" == "" ] && NAME=consoleproxy - setup_console_proxy; - ;; -esac - -if [ ! -d /root/.ssh ] -then - mkdir /root/.ssh - chmod 700 /root/.ssh -fi -if [ -f /mnt/id_rsa.pub ] -then - cat /mnt/id_rsa.pub > /root/.ssh/authorized_keys - chmod 600 /root/.ssh/authorized_keys -fi - diff --git a/patches/kvm/etc/sysconfig/iptables b/patches/kvm/etc/sysconfig/iptables deleted file mode 100755 index 5048fb6d670..00000000000 --- a/patches/kvm/etc/sysconfig/iptables +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by iptables-save v1.3.8 on Thu Oct 1 18:16:05 2009 -# @VERSION@ -*nat -:PREROUTING ACCEPT [499:70846] -:POSTROUTING ACCEPT [1:85] -:OUTPUT ACCEPT [1:85] -COMMIT -# Completed on Thu Oct 1 18:16:06 2009 -# Generated by iptables-save v1.3.8 on Thu Oct 1 18:16:06 2009 -*filter -#:INPUT DROP [288:42467] -:FORWARD DROP [0:0] -:OUTPUT ACCEPT [65:9665] --A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -p icmp -j ACCEPT --A INPUT -i eth0 -p udp -m udp --dport 67 -j ACCEPT --A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT --A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i eth1 -p tcp -m tcp --dport 3922 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT --A INPUT -i eth0 -p tcp -m tcp --dport 8080 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT --A INPUT -p tcp -m tcp --dport 8001 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT --A INPUT -p tcp -m tcp --dport 443 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT --A INPUT -p tcp -m tcp --dport 80 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT --A INPUT -i eth1 -p tcp -m state --state NEW -m tcp --dport 8001 -j ACCEPT --A INPUT -i eth2 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT --A INPUT -i eth2 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT --A FORWARD -i eth0 -o eth1 -j ACCEPT --A FORWARD -i eth0 -o eth2 -j ACCEPT --A FORWARD -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT --A FORWARD -i eth2 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT -COMMIT -# Completed on Thu Oct 1 18:16:06 2009 diff --git a/patches/kvm/etc/sysconfig/iptables-config b/patches/kvm/etc/sysconfig/iptables-config deleted file mode 100644 index c8a02b4a306..00000000000 --- a/patches/kvm/etc/sysconfig/iptables-config +++ /dev/null @@ -1,48 +0,0 @@ -# Load additional iptables modules (nat helpers) -# Default: -none- -# Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which -# are loaded after the firewall rules are applied. Options for the helpers are -# stored in /etc/modprobe.conf. -IPTABLES_MODULES="ip_conntrack_ftp nf_nat_ftp" - -# Unload modules on restart and stop -# Value: yes|no, default: yes -# This option has to be 'yes' to get to a sane state for a firewall -# restart or stop. Only set to 'no' if there are problems unloading netfilter -# modules. -IPTABLES_MODULES_UNLOAD="yes" - -# Save current firewall rules on stop. -# Value: yes|no, default: no -# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets stopped -# (e.g. on system shutdown). -IPTABLES_SAVE_ON_STOP="no" - -# Save current firewall rules on restart. -# Value: yes|no, default: no -# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets -# restarted. -IPTABLES_SAVE_ON_RESTART="no" - -# Save (and restore) rule and chain counter. -# Value: yes|no, default: no -# Save counters for rules and chains to /etc/sysconfig/iptables if -# 'service iptables save' is called or on stop or restart if SAVE_ON_STOP or -# SAVE_ON_RESTART is enabled. -IPTABLES_SAVE_COUNTER="no" - -# Numeric status output -# Value: yes|no, default: yes -# Print IP addresses and port numbers in numeric format in the status output. -IPTABLES_STATUS_NUMERIC="yes" - -# Verbose status output -# Value: yes|no, default: yes -# Print info about the number of packets and bytes plus the "input-" and -# "outputdevice" in the status output. -IPTABLES_STATUS_VERBOSE="no" - -# Status output with numbered lines -# Value: yes|no, default: yes -# Print a counter/number for every rule in the status output. -IPTABLES_STATUS_LINENUMBERS="yes" diff --git a/patches/kvm/etc/sysconfig/iptables-domp b/patches/kvm/etc/sysconfig/iptables-domp deleted file mode 100755 index 0a29cd3454f..00000000000 --- a/patches/kvm/etc/sysconfig/iptables-domp +++ /dev/null @@ -1,18 +0,0 @@ -# @VERSION@ -*nat -:PREROUTING ACCEPT [499:70846] -:POSTROUTING ACCEPT [1:85] -:OUTPUT ACCEPT [1:85] -COMMIT -*filter -:INPUT DROP [288:42467] -:FORWARD DROP [0:0] -:OUTPUT ACCEPT [65:9665] --A INPUT -i lo -j ACCEPT --A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -p icmp -j ACCEPT --A INPUT -i eth1 -p tcp -m state --state NEW -m tcp --dport 8001 -j ACCEPT --A INPUT -i eth2 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT --A INPUT -i eth2 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -COMMIT diff --git a/patches/kvm/etc/sysconfig/iptables-domr b/patches/kvm/etc/sysconfig/iptables-domr deleted file mode 100755 index c9f5010ed60..00000000000 --- a/patches/kvm/etc/sysconfig/iptables-domr +++ /dev/null @@ -1,23 +0,0 @@ -# @VERSION@ -*nat -:PREROUTING ACCEPT [499:70846] -:POSTROUTING ACCEPT [1:85] -:OUTPUT ACCEPT [1:85] -COMMIT -*filter -:INPUT DROP [288:42467] -:FORWARD DROP [0:0] -:OUTPUT ACCEPT [65:9665] --A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -p icmp -j ACCEPT --A INPUT -i lo -j ACCEPT --A INPUT -i eth0 -p udp -m udp --dport 67 -j ACCEPT --A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT --A INPUT -i eth1 -p tcp -m state --state NEW --dport 3922 -j ACCEPT --A INPUT -i eth0 -p tcp -m state --state NEW --dport 8080 -j ACCEPT --A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT --A FORWARD -i eth0 -o eth2 -j ACCEPT --A FORWARD -i eth2 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT -COMMIT diff --git a/patches/kvm/etc/sysctl.conf b/patches/kvm/etc/sysctl.conf deleted file mode 100755 index 69704598684..00000000000 --- a/patches/kvm/etc/sysctl.conf +++ /dev/null @@ -1,27 +0,0 @@ -# Kernel sysctl configuration file for Red Hat Linux -# -# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and -# sysctl.conf(5) for more details. -# @VERSION@ - -# Controls IP packet forwarding -net.ipv4.ip_forward = 1 - -# Controls source route verification -net.ipv4.conf.default.rp_filter = 1 - -# Do not accept source routing -net.ipv4.conf.default.accept_source_route = 0 - -# Controls the System Request debugging functionality of the kernel -kernel.sysrq = 0 - -# Controls whether core dumps will append the PID to the core filename. -# Useful for debugging multi-threaded applications. -kernel.core_uses_pid = 1 - -# Controls the use of TCP syncookies -net.ipv4.tcp_syncookies = 1 - -# VMOps Rudd-O increase conntrack limits, fix http://bugzilla.lab.vmops.com/show_bug.cgi?id=2008 -net.ipv4.netfilter.ip_conntrack_max=65536 diff --git a/patches/kvm/root/edithosts.sh b/patches/kvm/root/edithosts.sh deleted file mode 100755 index 06c961cf8a5..00000000000 --- a/patches/kvm/root/edithosts.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -# $Id: edithosts.sh 9947 2010-06-25 19:34:24Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/patches/kvm/root/edithosts.sh $ -# edithosts.sh -- edit the dhcphosts file on the routing domain -# $1 : the mac address -# $2 : the associated ip address -# $3 : the hostname -# @VERSION@ - -wait_for_dnsmasq () { - local _pid=$(/sbin/pidof dnsmasq) - for i in 0 1 2 3 4 5 6 7 8 9 10 - do - sleep 1 - _pid=$(/sbin/pidof dnsmasq) - [ "$_pid" != "" ] && break; - done - [ "$_pid" != "" ] && return 0; - echo "edithosts: timed out waiting for dnsmasq to start" - return 1 -} - -#delete any previous entries from the dhcp hosts file -sed -i /$1/d /etc/dhcphosts.txt -sed -i /$2,/d /etc/dhcphosts.txt -sed -i /$3,/d /etc/dhcphosts.txt - -#put in the new entry -echo "$1,$2,$3,infinite" >>/etc/dhcphosts.txt - -#delete leases to supplied mac and ip addresses -sed -i /$1/d /var/lib/misc/dnsmasq.leases -sed -i /"$2 "/d /var/lib/misc/dnsmasq.leases -sed -i /"$3 "/d /var/lib/misc/dnsmasq.leases - -#put in the new entry -echo "0 $1 $2 $3 *" >> /var/lib/misc/dnsmasq.leases - -#edit hosts file as well -sed -i /"$2 "/d /etc/hosts -sed -i /"$3"/d /etc/hosts -echo "$2 $3" >> /etc/hosts - -# send SIGHUP to make dnsmasq re-read files -pid=$(/sbin/pidof dnsmasq) -if [ "$pid" != "" ] -then - kill -1 $(/sbin/pidof dnsmasq) -else - wait_for_dnsmasq -fi - diff --git a/patches/kvm/etc/dnsmasq.conf b/patches/systemvm/etc/dnsmasq.conf similarity index 99% rename from patches/kvm/etc/dnsmasq.conf rename to patches/systemvm/etc/dnsmasq.conf index 238efc08d9b..234bcdaed5d 100755 --- a/patches/kvm/etc/dnsmasq.conf +++ b/patches/systemvm/etc/dnsmasq.conf @@ -74,13 +74,15 @@ resolv-file=/etc/dnsmasq-resolv.conf interface=eth0 # Or you can specify which interface _not_ to listen on except-interface=eth1 +except-interface=eth2 # Or which to listen on by address (remember to include 127.0.0.1 if # you use this.) #listen-address= # If you want dnsmasq to provide only DNS service on an interface, # configure it as shown above, and then use the following line to # disable DHCP on it. -#no-dhcp-interface=eth1 +no-dhcp-interface=eth1 +no-dhcp-interface=eth2 # On systems which support it, dnsmasq binds the wildcard address, # even when it is listening on only some interfaces. It then discards @@ -109,7 +111,7 @@ expand-hosts # 2) Sets the "domain" DHCP option thereby potentially setting the # domain of all systems configured by DHCP # 3) Provides the domain part for "expand-hosts" -domain=foo.com +#domain=foo.com # Uncomment this to enable the integrated DHCP server, you need # to supply the range of addresses available for lease and optionally @@ -248,7 +250,7 @@ dhcp-hostsfile=/etc/dhcphosts.txt #dhcp-option=27,1 # Set the domain -dhcp-option=15,"foo.com" +#dhcp-option=15,"foo.com" # Send the etherboot magic flag and then etherboot options (a string). #dhcp-option=128,e4:45:74:68:00:00 diff --git a/patches/kvm/etc/haproxy/haproxy.cfg b/patches/systemvm/etc/haproxy/haproxy.cfg similarity index 100% rename from patches/kvm/etc/haproxy/haproxy.cfg rename to patches/systemvm/etc/haproxy/haproxy.cfg diff --git a/patches/kvm/etc/hosts b/patches/systemvm/etc/hosts similarity index 100% rename from patches/kvm/etc/hosts rename to patches/systemvm/etc/hosts diff --git a/patches/kvm/etc/init.d/domr_webserver b/patches/systemvm/etc/init.d/domr_webserver similarity index 100% rename from patches/kvm/etc/init.d/domr_webserver rename to patches/systemvm/etc/init.d/domr_webserver diff --git a/patches/xenserver/etc/init.d/postinit b/patches/systemvm/etc/init.d/postinit similarity index 95% rename from patches/xenserver/etc/init.d/postinit rename to patches/systemvm/etc/init.d/postinit index ae17565c50b..681d5264fd9 100755 --- a/patches/xenserver/etc/init.d/postinit +++ b/patches/systemvm/etc/init.d/postinit @@ -26,7 +26,14 @@ setup_console_proxy() { echo "$public_ip $NAME" >> /etc/hosts } -CMDLINE=$(cat /proc/cmdline) + +if [ -f /mnt/cmdline ] +then + CMDLINE=$(cat /mnt/cmdline) +else + CMDLINE=$(cat /proc/cmdline) +fi + TYPE="router" BOOTPROTO="static" diff --git a/patches/xenserver/etc/init.d/seteth1 b/patches/systemvm/etc/init.d/seteth1 similarity index 94% rename from patches/xenserver/etc/init.d/seteth1 rename to patches/systemvm/etc/init.d/seteth1 index 01ae5724950..0081e664930 100755 --- a/patches/xenserver/etc/init.d/seteth1 +++ b/patches/systemvm/etc/init.d/seteth1 @@ -118,7 +118,7 @@ setup_dhcpsrvr() { sed -i -e "s/^dhcp-range=.*$/dhcp-range=$DHCP_RANGE,static/" /etc/dnsmasq.conf sed -i -e "s/^[#]*dhcp-option=option:router.*$/dhcp-option=option:router,$GW/" /etc/dnsmasq.conf #for now set up ourself as the dns server as well - #echo "dhcp-option=6,$NS1,$NS2" >> /etc/dnsmasq.conf + sed -i s/[#]*dhcp-option=6.*$/dhcp-option=6,\"$NS1\",\"$NS2\"/ /etc/dnsmasq.conf sed -i /gateway/d /etc/hosts echo "$ETH0_IP $NAME" >> /etc/hosts [ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*$/Listen $ETH0_IP:80/" /etc/httpd/conf/httpd.conf @@ -143,7 +143,25 @@ setup_console_proxy() { echo "$public_ip $NAME" >> /etc/hosts } -CMDLINE=$(cat /proc/cmdline) +if [ -f /mnt/cmdline ] +then + CMDLINE=$(cat /mnt/cmdline) +else + CMDLINE=$(cat /proc/cmdline) +fi + + +if [ ! -d /root/.ssh ] +then + mkdir /root/.ssh + chmod 700 /root/.ssh +fi +if [ -f /mnt/id_rsa.pub ] +then + cat /mnt/id_rsa.pub > /root/.ssh/authorized_keys + chmod 600 /root/.ssh/authorized_keys +fi + TYPE="router" BOOTPROTO="static" diff --git a/patches/kvm/etc/init.d/vmops b/patches/systemvm/etc/init.d/vmops similarity index 100% rename from patches/kvm/etc/init.d/vmops rename to patches/systemvm/etc/init.d/vmops diff --git a/patches/kvm/etc/rc.local b/patches/systemvm/etc/rc.local similarity index 100% rename from patches/kvm/etc/rc.local rename to patches/systemvm/etc/rc.local diff --git a/patches/kvm/etc/ssh/sshd_config b/patches/systemvm/etc/ssh/sshd_config similarity index 100% rename from patches/kvm/etc/ssh/sshd_config rename to patches/systemvm/etc/ssh/sshd_config diff --git a/patches/xenserver/etc/sysconfig/iptables-consoleproxy b/patches/systemvm/etc/sysconfig/iptables-consoleproxy similarity index 100% rename from patches/xenserver/etc/sysconfig/iptables-consoleproxy rename to patches/systemvm/etc/sysconfig/iptables-consoleproxy diff --git a/patches/xenserver/etc/sysconfig/iptables-domr b/patches/systemvm/etc/sysconfig/iptables-domr similarity index 100% rename from patches/xenserver/etc/sysconfig/iptables-domr rename to patches/systemvm/etc/sysconfig/iptables-domr diff --git a/patches/xenserver/etc/sysconfig/iptables-secstorage b/patches/systemvm/etc/sysconfig/iptables-secstorage similarity index 100% rename from patches/xenserver/etc/sysconfig/iptables-secstorage rename to patches/systemvm/etc/sysconfig/iptables-secstorage diff --git a/patches/xenserver/etc/sysctl.conf b/patches/systemvm/etc/sysctl.conf similarity index 100% rename from patches/xenserver/etc/sysctl.conf rename to patches/systemvm/etc/sysctl.conf diff --git a/patches/xenserver/root/.ssh/authorized_keys b/patches/systemvm/root/.ssh/authorized_keys similarity index 100% rename from patches/xenserver/root/.ssh/authorized_keys rename to patches/systemvm/root/.ssh/authorized_keys diff --git a/patches/xenserver/root/clearUsageRules.sh b/patches/systemvm/root/clearUsageRules.sh similarity index 100% rename from patches/xenserver/root/clearUsageRules.sh rename to patches/systemvm/root/clearUsageRules.sh diff --git a/patches/xenserver/root/edithosts.sh b/patches/systemvm/root/edithosts.sh similarity index 100% rename from patches/xenserver/root/edithosts.sh rename to patches/systemvm/root/edithosts.sh diff --git a/patches/xenserver/root/firewall.sh b/patches/systemvm/root/firewall.sh similarity index 100% rename from patches/xenserver/root/firewall.sh rename to patches/systemvm/root/firewall.sh diff --git a/patches/xenserver/root/loadbalancer.sh b/patches/systemvm/root/loadbalancer.sh similarity index 100% rename from patches/xenserver/root/loadbalancer.sh rename to patches/systemvm/root/loadbalancer.sh diff --git a/patches/xenserver/root/patchsystemvm.sh b/patches/systemvm/root/patchsystemvm.sh similarity index 100% rename from patches/xenserver/root/patchsystemvm.sh rename to patches/systemvm/root/patchsystemvm.sh diff --git a/patches/kvm/root/reconfigLB.sh b/patches/systemvm/root/reconfigLB.sh similarity index 100% rename from patches/kvm/root/reconfigLB.sh rename to patches/systemvm/root/reconfigLB.sh diff --git a/patches/kvm/root/run_domr_webserver b/patches/systemvm/root/run_domr_webserver similarity index 100% rename from patches/kvm/root/run_domr_webserver rename to patches/systemvm/root/run_domr_webserver diff --git a/patches/kvm/root/send_password_to_domu.sh b/patches/systemvm/root/send_password_to_domu.sh similarity index 100% rename from patches/kvm/root/send_password_to_domu.sh rename to patches/systemvm/root/send_password_to_domu.sh diff --git a/patches/shared/var/www/html/latest/.htaccess b/patches/systemvm/var/www/html/latest/.htaccess similarity index 100% rename from patches/shared/var/www/html/latest/.htaccess rename to patches/systemvm/var/www/html/latest/.htaccess diff --git a/patches/shared/var/www/html/metadata/.htaccess b/patches/systemvm/var/www/html/metadata/.htaccess similarity index 100% rename from patches/shared/var/www/html/metadata/.htaccess rename to patches/systemvm/var/www/html/metadata/.htaccess diff --git a/patches/shared/var/www/html/userdata/.htaccess b/patches/systemvm/var/www/html/userdata/.htaccess similarity index 100% rename from patches/shared/var/www/html/userdata/.htaccess rename to patches/systemvm/var/www/html/userdata/.htaccess diff --git a/patches/xenserver/etc/sysconfig/iptables-config b/patches/xenserver/etc/sysconfig/iptables-config deleted file mode 100644 index c8a02b4a306..00000000000 --- a/patches/xenserver/etc/sysconfig/iptables-config +++ /dev/null @@ -1,48 +0,0 @@ -# Load additional iptables modules (nat helpers) -# Default: -none- -# Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which -# are loaded after the firewall rules are applied. Options for the helpers are -# stored in /etc/modprobe.conf. -IPTABLES_MODULES="ip_conntrack_ftp nf_nat_ftp" - -# Unload modules on restart and stop -# Value: yes|no, default: yes -# This option has to be 'yes' to get to a sane state for a firewall -# restart or stop. Only set to 'no' if there are problems unloading netfilter -# modules. -IPTABLES_MODULES_UNLOAD="yes" - -# Save current firewall rules on stop. -# Value: yes|no, default: no -# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets stopped -# (e.g. on system shutdown). -IPTABLES_SAVE_ON_STOP="no" - -# Save current firewall rules on restart. -# Value: yes|no, default: no -# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets -# restarted. -IPTABLES_SAVE_ON_RESTART="no" - -# Save (and restore) rule and chain counter. -# Value: yes|no, default: no -# Save counters for rules and chains to /etc/sysconfig/iptables if -# 'service iptables save' is called or on stop or restart if SAVE_ON_STOP or -# SAVE_ON_RESTART is enabled. -IPTABLES_SAVE_COUNTER="no" - -# Numeric status output -# Value: yes|no, default: yes -# Print IP addresses and port numbers in numeric format in the status output. -IPTABLES_STATUS_NUMERIC="yes" - -# Verbose status output -# Value: yes|no, default: yes -# Print info about the number of packets and bytes plus the "input-" and -# "outputdevice" in the status output. -IPTABLES_STATUS_VERBOSE="no" - -# Status output with numbered lines -# Value: yes|no, default: yes -# Print a counter/number for every rule in the status output. -IPTABLES_STATUS_LINENUMBERS="yes" diff --git a/server/src/com/cloud/storage/LocalStoragePoolListener.java b/server/src/com/cloud/storage/LocalStoragePoolListener.java index 2c82edfe064..0f5770dddc8 100644 --- a/server/src/com/cloud/storage/LocalStoragePoolListener.java +++ b/server/src/com/cloud/storage/LocalStoragePoolListener.java @@ -92,6 +92,7 @@ public class LocalStoragePoolListener implements Listener { host.getPodId(), pInfo.getAvailableBytes(), pInfo.getCapacityBytes(), pInfo.getHost(), 0, pInfo.getHostPath()); pool.setClusterId(host.getClusterId()); + pool.setStatus(Status.Up); _storagePoolDao.persist(pool, pInfo.getDetails()); StoragePoolHostVO poolHost = new StoragePoolHostVO(pool.getId(), host.getId(), pInfo.getLocalPath()); _storagePoolHostDao.persist(poolHost);