Major Update.
authorroot <root@pines-dev-ubuntu.gapines.org>
Thu, 15 Nov 2012 19:08:59 +0000 (14:08 -0500)
committerroot <root@pines-dev-ubuntu.gapines.org>
Thu, 15 Nov 2012 19:08:59 +0000 (14:08 -0500)
=============

Updated to Evergreen 2.3.1 with OpenSRF 2.1.1

Streamlined code for setup scripts.

Added the ability to set a hostname prefix.

Added Ubuntu support.

Fixed bugs.

24 files changed:
GenaSYS.sh
genasys.conf-dist
templates/apache2/apache2.conf
templates/apache2/eg.conf
templates/apache2/eg_vhost.conf
templates/apache2/startup.pl
templates/apt/monitor01_apt.list [new file with mode: 0644]
templates/debs/evergreen-ils_2.3.1_amd64.deb [new file with mode: 0644]
templates/debs/libclass-dbi-frozen-301_3.0.1-1_amd64.deb [new file with mode: 0644]
templates/debs/opensrf_2.1.1_amd64.deb [new file with mode: 0644]
templates/debs/spidermonkey-perl_0.21-1_amd64.deb [new file with mode: 0644]
templates/eg-logger-root.crontab
templates/hosts-footer-prefixed [new file with mode: 0644]
templates/hosts-header-prefixed [new file with mode: 0644]
templates/opensrf.xml/opensrf.xml-drone
templates/opensrf.xml/opensrf.xml-full
templates/opensrf.xml/opensrf.xml-header
templates/opensrf.xml/version
templates/opensrf_core.xml
templates/setup-drone.sh
templates/setup-functions [new file with mode: 0644]
templates/setup-head.sh
templates/setup-vars [new file with mode: 0644]
templates/setup.sh

index e6c76af..7b03286 100755 (executable)
@@ -25,8 +25,8 @@
     PURPOSE_="Generate config files needed for Evergreen-ILS Cluster"
    SYNOPSIS_="$NAME_"
    REQUIRES_="standard GNU commands, apt, dpkg"
-    VERSION_="0.83"
-       DATE_="2010-09-18; last update: 2012-03-22"
+    VERSION_="0.96"
+       DATE_="2010-09-18; last update: 2012-11-10"
      AUTHOR_="Andy Witter <awitter@georgialibraries.org>"
         URL_="http://evergreen-ils.org"
    CATEGORY_="devel"
@@ -53,7 +53,7 @@ done
 
 WD=$(dirname $(readlink -f $0))
 CUSTOMDIR="$WD/custom"
-EG_VERSION="2.1.1"
+EG_VERSION="2.3.1"
 LICENSE="$WD/License.txt"
 TEMPLATEDIR="$WD/templates"
 DEFAULT_PRIVATE_NET="10.0.1"
@@ -68,6 +68,8 @@ PSQL_VERSION="9.1"
 [ -z $CONFIG_FILE ] && CONFIG_FILE="$WD/genasys.conf"
 NEW_CONFIG_FILE="$OUTDIR/genasys.conf"
 CERT_DIR="${OUTDIR}/ssl_cert"
+
+
 #TMPBRICKDRONES="/tmp/tmpbricknodes"
 
 
@@ -186,6 +188,7 @@ while true; do
         * ) echo " Please answer yes or no.";;
     esac
 done
+echo
 }
 
 Get_Domain_Name () { ### Get the domain name for the cluster.
@@ -198,6 +201,36 @@ echo -e "The Domain Name $COL_BR_YELLOW $CLUSTERDOMAINNAME $COL_RESET will be us
 echo
 }
 
+Get_Hostname_Prefix () { ### Get the prefix to for the hostname if there is one
+echo;echo;echo
+echo -e $COL_BR_BLUE"________Hostname Prefix Configuration________"$COL_RESET
+echo "There are times when a hostname prefix is desirable for differentiating"
+echo "between multiple clusters. For example by default the hostname for the logger"
+echo "server is logger01 however in a test cluster you may want to have your hostnames"
+echo "designated as eg. test-logger01 instead of the default logger01."
+echo "Selecting [y] here will allow you to choose a prefix to add to the hostnames"
+echo "of all the nodes in the cluster."
+echo
+while true; do
+    read -n 1 -p "Do you want to add a prefix to the hostnames in this cluster? eg. 'test'   [y/n] : " USE_HOSTNAME_PREFIX
+    case $USE_HOSTNAME_PREFIX in
+        [Yy]* ) echo ; break;;
+        [Nn]* ) echo ; break;;
+        * ) echo " Please answer yes or no.";;
+    esac
+done
+if [ "$USE_HOSTNAME_PREFIX" = "y" ] || [ "$USE_HOSTNAME_PREFIX" = "Y" ]
+       then
+       echo
+       echo -e $COL_BR_CYAN
+       read -p "Enter the hostname prefix eg. test : " HOSTNAME_PREFIX
+       echo -e $COL_RESET
+       echo 
+       echo -e "The hostname prefix $COL_BR_YELLOW $HOSTNAME_PREFIX $COL_RESET will be used."
+       echo
+fi
+}
+
 Choose_SSL_Cert () { ### Prompt for CA or self signed certificate.
 echo
 echo
@@ -277,7 +310,7 @@ Get_Brick_Layout () { ### Prompt for brick layout.
 echo;echo;echo
 echo -e $COL_BR_BLUE"_____________Evergreen_Brick Configuration_____________"$COL_RESET
 echo
-echo "The standard configuration for a brick is 2 drones per head."
+echo "The standard configuration for a brick is 2 separate drone servers per head."
 while true; do
     read -n 1 -p "Do you want to use the standard configuration? [y/n] : " USE_STANDARD_HEAD_CONFIG
     case $USE_STANDARD_HEAD_CONFIG in
@@ -290,7 +323,7 @@ done
 
 Get_Drone_Config () { ### Choose seperate or integrated drones
 while true; do
-       read -n 1 -p "Do you want to use separate drones in this configuration? [y/n]: " USEDRONES
+       read -n 1 -p "Do you want to use separate drone servers in this configuration? [y/n]: " USEDRONES
        case $USEDRONES in
                [Yy]* ) echo ; break;;
                [Nn]* ) echo ; break;;
@@ -340,11 +373,11 @@ while true; do
         echo
     read -n 1 -p "Select Host [1-5] : " REPORTS_MENU_SELECTION
     case $REPORTS_MENU_SELECTION in
-        [1]* ) REPORTS_NFS_HOSTNAME="db01" ; break;;
-        [2]* ) REPORTS_NFS_HOSTNAME="db02" ; break;;
-        [3]* ) REPORTS_NFS_HOSTNAME="db03" ; break;;
-        [4]* ) REPORTS_NFS_HOSTNAME="reporter01" ; break;;
-        [5]* ) echo ; echo -e $COL_BR_CYAN ; read -p "Enter new hostname: " REPORTS_NFS_HOSTNAME ; break;;
+        [1]* ) CHOSEN_REPORTS_NFS_HOSTNAME="db01" ; break;;
+        [2]* ) CHOSEN_REPORTS_NFS_HOSTNAME="db02" ; break;;
+        [3]* ) CHOSEN_REPORTS_NFS_HOSTNAME="db03" ; break;;
+        [4]* ) CHOSEN_REPORTS_NFS_HOSTNAME="reporter01" ; break;;
+        [5]* ) echo ; echo -e $COL_BR_CYAN ; read -p "Enter new hostname: " CHOSEN_REPORTS_NFS_HOSTNAME ; break;;
 
 
         * ) echo " Please select choice [1-5].";;
@@ -352,7 +385,13 @@ while true; do
 done
 echo -e $COL_RESET
 echo
-echo;echo -e $COL_BR_BLUE"Setting up reports output NFS share on"$COL_RESET $COL_BR_GREEN"$REPORTS_NFS_HOSTNAME"$COL_RESET
+#if [  "$USE_HOSTNAME_PREFIX" = "y" ] || [ "$USE_HOSTNAME_PREFIX" = "Y" ]
+#      then
+#              REPORTS_NFS_HOSTNAME="${HOSTNAME_PREFIX}-${CHOSEN_REPORTS_NFS_HOSTNAME}"
+#      else
+#              REPORTS_NFS_HOSTNAME="${CHOSEN_REPORTS_NFS_HOSTNAME}"
+#fi
+echo;echo -e $COL_BR_BLUE"Setting up reports output NFS share on"$COL_RESET $COL_BR_GREEN"${REPORTS_NFS_HOSTNAME}.${CLUSTERDOMAINNAME}"$COL_RESET
 sleep 2
 }
 
@@ -364,13 +403,21 @@ echo
 echo "Open Service Request Framework requires"
 echo "credentials configured for authentication"
 echo
-read -p "Enter OpenSRF Password: " OPENSRF_PASSWORD
+read -sp "Enter OpenSRF Password: " OPENSRF_PASSWORD
 while [ "$OPENSRF_PASSWORD" = "" ]
         do
         echo
        MORON="1"
-        echo "Cannot be blank - you must enter a password"
-        read -p "Enter the opensrf password: " OPENSRF_PASSWORD
+        echo -e $COL_BR_RED"Cannot be blank - you must enter a password"$COL_RESET
+        read -sp "Enter the opensrf password: " OPENSRF_PASSWORD
+done
+echo
+read -sp "Confirm OpenSRF Password: " OPENSRF_PASSWORD_CONFIRM
+while [ "$OPENSRF_PASSWORD_CONFIRM" = "" ]
+        do
+        echo
+        echo -e $COL_BR_RED"Cannot be blank - you must enter a password"$COL_RESET
+        read -sp "Confirm the opensrf password: " OPENSRF_PASSWORD_CONFIRM
 done
 }
 
@@ -378,7 +425,7 @@ Get_DB_Cred () { ### Prompt for Database Credentials.
 echo;echo;echo
 echo -e $COL_BR_BLUE"________Evergreen database configuration________"$COL_RESET
 echo
-read -p "Enter the database password: " DATABASE_PASSWORD
+read -sp "Enter the database password: " DATABASE_PASSWORD
 while [ "$DATABASE_PASSWORD" = "" ]
         do
        if [ "$MORON" = "1" ]
@@ -393,14 +440,21 @@ while [ "$DATABASE_PASSWORD" = "" ]
                sleep 3
                echo "Try not to be a moron this time"
                sleep 2
-               read -p "Enter the database password: " DATABASE_PASSWORD
+               read -sp "Enter the database password: " DATABASE_PASSWORD
                        else
                        echo
                        MORON=1
-                       echo "Cannot be blank you must enter a password"
-                       read -p "Enter the database password: " DATABASE_PASSWORD
+                       echo -e $COL_BR_RED"Cannot be blank you must enter a password"$COL_RESET
+                       read -sp "Enter the database password: " DATABASE_PASSWORD
        fi
 done
+echo
+read -sp "Confirm the database password: " DATABASE_PASSWORD_CONFIRM
+while [ "$DATABASE_PASSWORD_CONFIRM" = "" ]
+        do
+       echo -e $COL_BR_RED"Cannot be blank you must enter a password"$COL_RESET
+       read -sp "Confirm the database password: " DATABASE_PASSWORD_CONFIRM
+done
 }
 
 Get_EG_Admin_User () { ### Prompt for Evergreen admin username.
@@ -412,12 +466,19 @@ read -p "Enter the Evergreen Administrator Username: " EG_ADMIN_USER
 
 Get_EG_Admin_Password () { ### Prompt for Evergreen admin password.
 echo
-read -p "Enter the Evergreen Administrator Password: " EG_ADMIN_PASSWORD
-while [ -z "$EG_ADMIN_PASSWORD" ]
+read -sp "Enter the Evergreen Administrator Password: " EG_ADMIN_PASSWORD
+while [ "$EG_ADMIN_PASSWORD" = "" ]
        do 
        echo
        echo -e $COL_BR_RED"Cannot be blank you must enter a password"$COL_RESET
-       read -p "Enter the Evergreen Administrator Password: " EG_ADMIN_PASSWORD
+       read -sp "Enter the Evergreen Administrator Password: " EG_ADMIN_PASSWORD
+done
+echo
+read -sp "Confirm the Evergreen Administrator Password: " EG_ADMIN_PASSWORD_CONFIRM
+while [ "$EG_ADMIN_PASSWORD_CONFIRM" == "" ]
+       do
+       echo -e $COL_BR_RED"Cannot be blank you must enter a password"$COL_RESET
+        read -sp "Enter the Evergreen Administrator Password: " EG_ADMIN_PASSWORD_CONFIRM
 done
 }
 
@@ -612,6 +673,15 @@ while true; do
 done
 }
 
+Confirm_Password () { ### Confirm Password 
+while [ $(eval echo "$1") != $(eval echo "$2") ]
+       do
+       echo -e $COL_BR_RED"Passwords do not match"$COL_RESET
+       sleep 2
+       $3
+done
+}
+
 Write_Config_File () { ### Add to new config file.
 eval echo  $@=\\\"\$$@\\\" >> $NEW_CONFIG_FILE
 }
@@ -645,10 +715,11 @@ Choose_Detected_Domain_Name
                        CLUSTERDOMAINNAME="$(hostname -d)"
        fi
 fi
+
 ### Set output directory.
 OUTDIR="$WD/config/${CLUSTERDOMAINNAME}_evergreen_config"
 
-### Move old output directory to backup and creat new one.
+### Move old output directory to backup and create new one.
 [ -d "$OUTDIR" ] && mv $OUTDIR "${OUTDIR}_$(date +%m%d%Y_%H%M)"
 mkdir -p $OUTDIR
 
@@ -668,11 +739,19 @@ echo >> $NEW_CONFIG_FILE
 
 Write_Config_File CLUSTERDOMAINNAME 
 
+### Prompt to get hostname prefix
+if [ -z "$HOSTNAME_PREFIX" ] || [ "$USE_CONFIG_FILE" == "0" ]
+        then
+        Get_Hostname_Prefix
+fi
+Write_Config_File HOSTNAME_PREFIX
+
 if [ -z $USE_CA_CERT ]  || [ "$USE_CONFIG_FILE" == "0" ] 
        then
        Choose_SSL_Cert
 fi
-echo "USE_CA_CERT=\"$USE_CA_CERT\"" >> $NEW_CONFIG_FILE
+#echo "USE_CA_CERT=\"$USE_CA_CERT\"" >> $NEW_CONFIG_FILE
+Write_Config_File USE_CA_CERT
 
 if [ "$USE_CA_CERT" == "N" ] || [ "$USE_CA_CERT" == "n" ]
        then
@@ -719,21 +798,35 @@ if [ -z $BRICKCOUNT ] || [ "$USE_CONFIG_FILE" == "0" ]
 fi
 Write_Config_File BRICKCOUNT
 
-if [ -z $REPORTS_NFS_HOSTNAME ] || [ "$USE_CONFIG_FILE" == "0" ] 
+if [ -z $CHOSEN_REPORTS_NFS_HOSTNAME ] || [ "$USE_CONFIG_FILE" == "0" ] 
        then
        EG_Reporter
 fi
-Write_Config_File REPORTS_NFS_HOSTNAME
+if [ "$USE_HOSTNAME_PREFIX" = "y" ] || [ "$USE_HOSTNAME_PREFIX" = "Y" ]
+       then
+        REPORTS_NFS_HOSTNAME="${HOSTNAME_PREFIX}-${CHOSEN_REPORTS_NFS_HOSTNAME}"
+        else
+        REPORTS_NFS_HOSTNAME="${CHOSEN_REPORTS_NFS_HOSTNAME}"
+fi
+[ -z "${CHOSEN_REPORTS_NFS_HOSTNAME}" ] && CHOSEN_REPORTS_NFS_HOSTNAME="$REPORTS_NFS_HOSTNAME"
+Write_Config_File CHOSEN_REPORTS_NFS_HOSTNAME
 
 if [ -z $OPENSRF_PASSWORD ] || [ "$USE_CONFIG_FILE" == "0" ] 
        then
        Get_OSRF_Cred
+       Confirm_Password '$OPENSRF_PASSWORD' '$OPENSRF_PASSWORD_CONFIRM' Get_OSRF_Cred
+       #while [ "$OPENSRF_PASSWORD" != "$OPENSRF_PASSWORD_CONFIRM" ]
+       #       do
+       #       Get_OSRF_Cred
+       #done
 fi
 Write_Config_File OPENSRF_PASSWORD
 
 if [ -z $DATABASE_PASSWORD ] || [ "$USE_CONFIG_FILE" == "0" ] 
        then
        Get_DB_Cred
+       Confirm_Password '$DATABASE_PASSWORD' '$DATABASE_PASSWORD_CONFIRM' Get_DB_Cred
+       
 fi
 Write_Config_File DATABASE_PASSWORD
 
@@ -746,6 +839,7 @@ Write_Config_File EG_ADMIN_USER
 if [ -z $EG_ADMIN_PASSWORD ] || [ "$USE_CONFIG_FILE" == "0" ] 
        then
        Get_EG_Admin_Password
+       Confirm_Password '$EG_ADMIN_PASSWORD' '$EG_ADMIN_PASSWORD_CONFIRM' Get_EG_Admin_Password
 fi
 Write_Config_File EG_ADMIN_PASSWORD
 
@@ -823,6 +917,72 @@ GetNetInfo ${CLUSTERIPADDRESS} ${CLUSTERNETMASK}
 CLUSTER_CIDR=$(Mask2CIDR ${CLUSTERNETMASK})
 
 
+### Set hostnames for cluster nodes
+
+if [ "$USE_HOSTNAME_PREFIX" = "y" ] || [ "$USE_HOSTNAME_PREFIX" = "Y" ]; then
+
+### With hostname prefix.
+PRFX="$HOSTNAME_PREFIX"
+
+       ### All the machines in the cluster except BRICKS and LVS servers.
+       MACHINES_NO_BRICKS_LVS="${PRFX}-db01 ${PRFX}-db02 ${PRFX}-db03 ${PRFX}-logger01 ${PRFX}-utility01 ${PRFX}-sip01 ${PRFX}-sip02 ${PRFX}-reporter01 ${PRFX}-memcache01 ${PRFX}-memcache02 ${PRFX}-monitor01 ${PRFX}-backup01 ${PRFX}-admin01"
+
+       ### All the machines in the cluster except BRICKS.
+       MACHINES_NO_BRICKS="${PRFX}-lvs01 ${PRFX}-lvs02 ${PRFX}-db01 ${PRFX}-db02 ${PRFX}-db03 ${PRFX}-logger01 ${PRFX}-utility01 ${PRFX}-sip01 ${PRFX}-sip02 ${PRFX}-reporter01 ${PRFX}-memcache01 ${PRFX}-memcache02 ${PRFX}-monitor01 ${PRFX}-backup01 ${PRFX}-admin01"
+
+       ### All OpenSRF nodes except bricks.
+       MACHINES_OSRF_NO_BRICKS="${PRFX}-utility01 ${PRFX}-sip01 ${PRFX}-sip02 ${PRFX}-reporter01"
+
+       ### Only LVS machines.
+       MACHINES_LVS_ONLY="${PRFX}-lvs01 ${PRFX}-lvs02"
+
+       ### Only SIP machines.
+       MACHINES_SIP_ONLY="${PRFX}-sip01 ${PRFX}-sip02"
+
+       ### Only DB machines.
+       MACHINES_DB_ONLY="${PRFX}-db01 ${PRFX}-db02 ${PRFX}-db03"
+       
+       ### Only logger machines.
+       MACHINES_LOGGER="${PRFX}-logger01"
+       
+       ### Only utility machines.
+       MACHINES_UTILITY="${PRFX}-utility01"
+
+       ### Only backup machines.
+       MACHINES_BACKUP="${PRFX}-backup01"
+
+else
+
+### Without hostname prefix.
+
+       ### All the machines in the cluster except BRICKS and LVS servers.
+       MACHINES_NO_BRICKS_LVS="db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01"
+
+       ### All the machines in the cluster except BRICKS.
+       MACHINES_NO_BRICKS="lvs01 lvs02 db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01"
+
+       ### All OpenSRF nodes except bricks.
+       MACHINES_OSRF_NO_BRICKS="utility01 sip01 sip02 reporter01"
+
+       ### Only LVS machines.
+       MACHINES_LVS_ONLY="lvs01 lvs02"
+
+       ### Only SIP machines.
+       MACHINES_SIP_ONLY="sip01 sip02"
+
+       ### Only DB machines.
+       MACHINES_DB_ONLY="db01 db02 db03"
+
+       ### Only logger machines.
+        MACHINES_LOGGER="logger01"
+
+       ### Only utility machines.
+        MACHINES_UTILITY="utility01"
+
+        ### Only backup machines.
+        MACHINES_BACKUP="backup01"
+fi
+
 ### Setup Privatenet IP for all hosts except bricks.
 LVS01_PRIVATE_SHARED_IP="${PRIVATENET}.1"
 LVS01_PRIVATE_IP="${PRIVATENET}.2"
@@ -854,7 +1014,7 @@ sed -i "s^CLUSTER_DOMAIN_NAME^$CLUSTERDOMAINNAME^g" "/tmp/resolv.conf"
 LVSCONFIGFILE="/tmp/ldirectord.cf"
 echo "virtual=${CLUSTERIPADDRESS}:80" > "$LVSCONFIGFILE"
 
-for LVS in lvs01 lvs02
+for LVS in $MACHINES_LVS_ONLY
         do
        LVSDIR="$LVS/etc/ha.d"
         mkdir -p "$OUTDIR/$LVSDIR"
@@ -883,7 +1043,13 @@ done
 
 
 ### Start hosts file configuration.
-cp $TEMPLATEDIR/hosts-footer /tmp
+if [ "$USE_HOSTNAME_PREFIX" = "y" ] || [ "$USE_HOSTNAME_PREFIX" = "Y" ]
+       then
+       cp $TEMPLATEDIR/hosts-footer-prefixed /tmp/hosts-footer
+       sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" /tmp/hosts-footer
+               else 
+               cp $TEMPLATEDIR/hosts-footer /tmp
+fi
 sed -i "s^Priv_NET^${PRIVATENET}^g" /tmp/hosts-footer
 sed -i "s^ClusterDomainName^${CLUSTERDOMAINNAME}^g" /tmp/hosts-footer
 
@@ -944,12 +1110,27 @@ CLUSTER_TLD="$(echo $CLUSTERDOMAINNAME |awk -F"." '{ print $NF }')"
 ######## Create Output Tree #########
 ######## ------------------ #########
 
+### Prepare global hosts temp file.
 [ -e "$TMPHOSTS" ] && rm -f "$TMPHOSTS"
 [ -e "$TMPOSRFNODES" ] && rm -f "$TMPOSRFNODES"
-cat $TEMPLATEDIR/hosts-header > "$TMPHOSTS"
-#echo "$LVS01_PRIVATE_SHARED_IP ${CLUSTERDOMAINNAME}" >> "$TMPHOSTS" 
-echo "$LVS01_PRIVATE_IP lvs01.${CLUSTERDOMAINNAME}  lvs01 " >> "$TMPHOSTS"
-echo "$LVS02_PRIVATE_IP lvs02.${CLUSTERDOMAINNAME}  lvs02 " >> "$TMPHOSTS"
+if [ "$USE_HOSTNAME_PREFIX" = "y" ] || [ "$USE_HOSTNAME_PREFIX" = "Y" ]
+       then
+       cat $TEMPLATEDIR/hosts-header-prefixed > "$TMPHOSTS"
+       sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" "$TMPHOSTS"
+               else
+               cat $TEMPLATEDIR/hosts-header > "$TMPHOSTS"
+fi
+
+### Add lvs servers entry to the global hosts file 
+NUM=0
+for LVS_SERVERS in $MACHINES_LVS_ONLY 
+       do
+       ((NUM++))
+       #echo "$LVS01_PRIVATE_IP $LVS_SERVERS.${CLUSTERDOMAINNAME}  $LVS_SERVERS " >> "$TMPHOSTS"
+       eval echo "\$LVS0${NUM}_PRIVATE_IP $LVS_SERVERS.${CLUSTERDOMAINNAME}  $LVS_SERVERS " >> "$TMPHOSTS"
+done
+
+### set the name of the network config file.
 NETCFGFILE="$OUTDIR/${CLUSTERDOMAINNAME}_network_config.txt"
 
 ## begin preparation of opensrf.xml
@@ -971,7 +1152,11 @@ fi
 CreateBricks () { ### Create config for Bricks without separate drones. DRONELESS
 for BRICK in $(seq $BRICKCOUNT)
         do
+       if [ -z "$HOSTNAME_PREFIX" ] ; then
         typeset BRICKHOSTNAME${BRICK}="brick0${BRICK}"
+               else
+               typeset BRICKHOSTNAME${BRICK}="${HOSTNAME_PREFIX}-brick0${BRICK}"
+       fi
         echo >> "$NETCFGFILE"
         eval echo \$BRICKHOSTNAME${BRICK} >> "$NETCFGFILE"
         echo "Brick${BRICK} hostname set to: $(eval echo \$BRICKHOSTNAME${BRICK})" >> "$NETCFGFILE"
@@ -1028,11 +1213,18 @@ for BRICK in $(seq $BRICKCOUNT)
        [ "$CA_FILES_EXIST" = "y" ] &&  sed -i "s^#SSLCACertificateFile ssl/ca.crt^SSLCACertificateFile ssl/ca.crt^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/apache2/sites-available/eg.conf
         eval sed -i "s^Priv_IP^$(eval echo \$BRICKHOSTNAME${BRICK}_HEAD_IP)^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
         eval sed -i "s^Priv_NET^$PRIVATENET^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
+       eval sed -i "s^LVS01_Private_IP^$LVS01_PRIVATE_IP^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
+       eval sed -i "s^LVS02_Private_IP^$LVS02_PRIVATE_IP^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
+       eval sed -i "s^Cluster_Private_IP^$LVS01_PRIVATE_SHARED_IP^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
+       eval sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
         #eval cp -f $TEMPLATEDIR/init/eg_opensrf ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/init.d/opensrf
         eval cp -f $TEMPLATEDIR/setup-head.sh ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head
+       eval cp -f $TEMPLATEDIR/setup-vars ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-vars
+       eval cp -f "$TEMPLATEDIR/setup-functions" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-functions"
         eval sed -i "s^head_file^$(eval echo \$BRICKHOSTNAME${BRICK}-head)^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
-       eval sed -i "s^_GENVER^${VERSION_}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
-       eval sed -i "s^_EGVER^${EG_VERSION}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
+       eval sed -i "s^_EGVER^${VERSION_}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
+       eval sed -i "s^_GENVER^${VERSION_}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-vars
+       eval sed -i "s^_EGVER^${EG_VERSION}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-vars
        eval sed -i "s^Brick01_Head_IP^$BRICK01_HEAD_IP^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
         eval sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
         eval cp -f $TEMPLATEDIR/apt/head_apt.list ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/\$BRICKHOSTNAME${BRICK}-head_apt.list
@@ -1056,13 +1248,18 @@ for BRICK in $(seq $BRICKCOUNT)
         do
         eval cat $TMPHOSTS >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hosts
         eval sed -i "s^thishost^$(eval echo \$BRICKHOSTNAME${BRICK})-head^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hosts
+       [ -z "$HOSTNAME_PREFIX" ] || sed -i "s^${HOSTNAME_PREFIX}-${HOSTNAME_PREFIX}^${HOSTNAME_PREFIX}^g"  ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hosts
         done
 }
 
 CreateBricksAndDrones () { ### Create config for bricks with seperate drones
 for BRICK in $(seq $BRICKCOUNT)
        do
-       typeset BRICKHOSTNAME${BRICK}="brick0${BRICK}"
+       if [ -z "$HOSTNAME_PREFIX" ] ; then
+        typeset BRICKHOSTNAME${BRICK}="brick0${BRICK}"
+                else
+                typeset BRICKHOSTNAME${BRICK}="${HOSTNAME_PREFIX}-brick0${BRICK}"
+        fi
        echo >> "$NETCFGFILE"
        eval echo \$BRICKHOSTNAME${BRICK} >> "$NETCFGFILE"
        echo "Brick${BRICK} hostname set to: $(eval echo \$BRICKHOSTNAME${BRICK})" >> "$NETCFGFILE"
@@ -1117,13 +1314,20 @@ for BRICK in $(seq $BRICKCOUNT)
        [ "$CA_FILES_EXIST" = "y" ] &&  sed -i "s^#SSLCACertificateFile ssl/ca.crt^SSLCACertificateFile ssl/ca.crt^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/apache2/sites-available/eg.conf
        eval sed -i "s^Priv_IP^$(eval echo \$BRICKHOSTNAME${BRICK}_HEAD_IP)^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
        eval sed -i "s^Priv_NET^$PRIVATENET^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
+       eval sed -i "s^LVS01_Private_IP^$LVS01_PRIVATE_IP^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
+       eval sed -i "s^LVS02_Private_IP^$LVS02_PRIVATE_IP^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
+       eval sed -i "s^Cluster_Private_IP^$LVS01_PRIVATE_SHARED_IP^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
+       eval sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/network/interfaces
        eval cp -f $TEMPLATEDIR/exports ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/
        eval echo "/openils/var/data/offline \$BRICKHOSTNAME${BRICK}_HEAD_IP\(rw,sync,no_subtree_check\)" >> /tmp/exports
        eval echo "/storage/reports-output \$BRICKHOSTNAME${BRICK}_HEAD_IP\(ro,sync,no_subtree_check\)" >> /tmp/exports_reporter
        # eval cp -f $TEMPLATEDIR/init/eg_opensrf ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/init.d/opensrf
        eval cp -f $TEMPLATEDIR/setup-head.sh ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head
-       eval sed -i "s^_GENVER^${VERSION_}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
-       eval sed -i "s^_EGVER^${EG_VERSION}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
+       eval cp -f $TEMPLATEDIR/setup-vars ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-vars
+       eval cp -f "$TEMPLATEDIR/setup-functions" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-functions"
+       eval sed -i "s^_EGVER^${VERSION_}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
+       eval sed -i "s^_GENVER^${VERSION_}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-vars
+       eval sed -i "s^_EGVER^${EG_VERSION}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-vars
        eval sed -i "s^head_file^$(eval echo \$BRICKHOSTNAME${BRICK}-head)^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
        eval sed -i "s^Brick01_Head_IP^$BRICK01_HEAD_IP^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
        eval sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/setup-head.sh
@@ -1135,6 +1339,14 @@ for BRICK in $(seq $BRICKCOUNT)
                for DRONE in $(seq $DRONECOUNT)
                do
                typeset TMPBRICKDRONES="$(eval echo \$BRICKHOSTNAME${BRICK}-head)_drones.txt"
+               #if [ -z "$HOSTNAME_PREFIX" ] ; then
+               #       typeset BRICKHOSTNAME${BRICK}_DRONE${DRONE}="$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})"
+               #       echo "Brick${BRICK} Drone${DRONE} hostname set to: $(eval echo "\$BRICKHOSTNAME${BRICK}_DRONE${DRONE}")" >> "$NETCFGFILE"
+                #else
+               #       typeset BRICKHOSTNAME${BRICK}_DRONE${DRONE}="$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})"
+               #       echo "Brick${BRICK} Drone${DRONE} hostname set to: $(eval echo "\$BRICKHOSTNAME${BRICK}_DRONE${DRONE}")" >> "$NETCFGFILE"
+               #fi
+
                typeset BRICKHOSTNAME${BRICK}_DRONE${DRONE}="$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})"
                echo "Brick${BRICK} Drone${DRONE} hostname set to: $(eval echo "\$BRICKHOSTNAME${BRICK}_DRONE${DRONE}")" >> "$NETCFGFILE"
                typeset BRICKHOSTNAME${BRICK}_DRONE${DRONE}_IP="$PRIVATENET.${BRICK}${DRONE}"
@@ -1154,16 +1366,23 @@ for BRICK in $(seq $BRICKCOUNT)
                eval cp -f $TEMPLATEDIR/eg_fstab_drone "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc"
                #eval cp -f $TEMPLATEDIR/init/eg_opensrf "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc/init.d/opensrf"
                eval cp -f $TEMPLATEDIR/setup-drone.sh "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}"
+               eval cp -f $TEMPLATEDIR/setup-vars "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/setup-vars"
+               eval cp -f "$TEMPLATEDIR/setup-functions" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/setup-functions"
                eval cp -f $TEMPLATEDIR/apt/drone_apt.list "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}_apt.list"
                eval cp -f /tmp/rsyslog.conf "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc"
                eval sed -i "s^drone_file^$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/setup-drone.sh"
-               eval sed -i "s^_GENVER^${VERSION_}^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/setup-drone.sh"
                eval sed -i "s^_EGVER^${EG_VERSION}^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/setup-drone.sh"
+               eval sed -i "s^_GENVER^${VERSION_}^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/setup-vars"
+               eval sed -i "s^_EGVER^${EG_VERSION}^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/setup-vars"
                eval sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/setup-drone.sh"
                eval sed -i "s^HEAD_IP^$(eval echo \$BRICKHOSTNAME${BRICK}_HEAD_IP)^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc/eg_fstab_drone"
                eval sed -i "s^UTILITY01_IP^$UTILITY01_IP^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc/eg_fstab_drone"
                eval sed -i "s^Priv_IP^$(eval echo \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}_IP)^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc/network/interfaces"
                eval sed -i "s^Priv_NET^$PRIVATENET^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc/network/interfaces"
+               eval sed -i "s^LVS01_Private_IP^$LVS01_PRIVATE_IP^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc/network/interfaces"
+               eval sed -i "s^LVS02_Private_IP^$LVS02_PRIVATE_IP^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc/network/interfaces"
+               eval sed -i "s^Cluster_Private_IP^$LVS01_PRIVATE_SHARED_IP^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc/network/interfaces"
+               eval sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" "${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-drone0${DRONE}/etc/network/interfaces"
                #eval sed -i "s^DRONE_IP^$(eval echo \$BRICKHOSTNAME${BRICK}_HEAD_IP)^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/exports
                eval echo "/openils \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}_IP\(ro,sync,no_subtree_check\)" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/exports
                printf '\"' >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/openils/conf/.oils_brick.cfg
@@ -1196,10 +1415,15 @@ for BRICK in $(seq $BRICKCOUNT)
         do
         eval cat $TMPHOSTS >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hosts
         eval sed -i "s^thishost^$(eval echo \$BRICKHOSTNAME${BRICK})-head^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hosts
+       [ -z "$HOSTNAME_PREFIX" ] || sed -i "s^${HOSTNAME_PREFIX}-${HOSTNAME_PREFIX}^${HOSTNAME_PREFIX}^g"  ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hosts
                 for DRONE in $(seq $DRONECOUNT)
                 do
                 eval cat $TMPHOSTS >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-drone0${DRONE}/etc/hosts
                 eval sed -i "s^thishost^$(eval echo \$BRICKHOSTNAME${BRICK})-drone0${DRONE}^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-drone0${DRONE}/etc/hosts
+               [ -z "$HOSTNAME_PREFIX" ] || sed -i "s^${HOSTNAME_PREFIX}-${HOSTNAME_PREFIX}^${HOSTNAME_PREFIX}^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-drone0${DRONE}/etc/hosts
+               #if [ -z "$HOSTNAME_PREFIX" ] ; then
+               #sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" {OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-drone0${DRONE}/etc/hosts
+               #fi
                 done
 
 done
@@ -1212,11 +1436,13 @@ if [ "$DRONELESS" == "1" ]
        echo Creating bricks without separate drones please wait....
        sleep 1
        CreateBricks
+       echo "done!"
                else
                echo
                echo Creating bricks with separate drones please wait....
                sleep 1
                CreateBricksAndDrones
+               echo "done!"
 fi
 
 ### Add reporter01 to reporter exports share
@@ -1244,45 +1470,82 @@ cat /tmp/ldirectord.conf >> "$LVSCONFIGFILE"
 sed -i "s^Priv_NET^$PRIVATENET^g" "$LVSCONFIGFILE"
 
 ### Complete LVS Director config.
-for LVS in lvs01 lvs02
+for LVS in $MACHINES_LVS_ONLY
        do
        cp -f $LVSCONFIGFILE $OUTDIR/$LVS/etc/ha.d
 done
 
 ### Setup hosts file for LVS
-cp -f "$TMPHOSTS" "$OUTDIR/lvs01/etc/hosts" && sed -i "s^thishost^lvs01^g" "$OUTDIR/lvs01/etc/hosts"
-cp -f "$TMPHOSTS" "$OUTDIR/lvs02/etc/hosts" && sed -i "s^thishost^lvs02^g" "$OUTDIR/lvs02/etc/hosts"
+for LVS_SERVER in $MACHINES_LVS_ONLY
+       do
+       cp -f "$TMPHOSTS" "$OUTDIR/$LVS_SERVER/etc/hosts" && sed -i "s^thishost^$LVS_SERVER^g" "$OUTDIR/$LVS_SERVER/etc/hosts"
+       [ -z $HOSTNAME_PREFIX ] || sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" "$OUTDIR/$LVS_SERVER/etc/hosts"
+       [ -z "$HOSTNAME_PREFIX" ] || sed -i "s^${HOSTNAME_PREFIX}-${HOSTNAME_PREFIX}^${HOSTNAME_PREFIX}^g" "$OUTDIR/$LVS_SERVER/etc/hosts"
+               
+done
+#cp -f "$TMPHOSTS" "$OUTDIR/lvs01/etc/hosts" && sed -i "s^thishost^lvs01^g" "$OUTDIR/lvs01/etc/hosts"
+#[ -z $HOSTNAME_PREFIX ] && sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" "$OUTDIR/lvs01/etc/hosts"
+#cp -f "$TMPHOSTS" "$OUTDIR/lvs02/etc/hosts" && sed -i "s^thishost^lvs02^g" "$OUTDIR/lvs02/etc/hosts"
+#[ -z $HOSTNAME_PREFIX ] && sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" "$OUTDIR/lvs01/etc/hosts"
 
 ### Setup hosts file all except lvs and bricks.
-for HOSTS in db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01 
+#for HOSTS in db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01 
+for HOSTS in $MACHINES_NO_BRICKS
        do
        mkdir -p "$OUTDIR/$HOSTS/etc/network" && \
        cp -f "$TMPHOSTS" "$OUTDIR/$HOSTS/etc/hosts" && \
        sed -i "s^thishost^$HOSTS^g" "$OUTDIR/$HOSTS/etc/hosts"
+       [ -z $HOSTNAME_PREFIX ] || sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" "$OUTDIR/$HOSTS/etc/hosts"
+       [ -z "$HOSTNAME_PREFIX" ] || sed -i "s^${HOSTNAME_PREFIX}-${HOSTNAME_PREFIX}^${HOSTNAME_PREFIX}^g" "$OUTDIR/$HOSTS/etc/hosts"
 done
 
 
 
 ### Setup LVS Interfaces file.
-for LVS in lvs01 lvs02
+NUM=0
+for LVS in $MACHINES_LVS_ONLY
        do
+       ((NUM++))
        cp -f "$TEMPLATEDIR/lvs/interfaces" "$OUTDIR/$LVS/etc/network"
        sed -i "s^Pub_NETMASK^$CLUSTERNETMASK^g" "$OUTDIR/$LVS/etc/network/interfaces"
        sed -i "s^Pub_GATEWAY^$CLUSTERGATEWAY^g" "$OUTDIR/$LVS/etc/network/interfaces"
        sed -i "s^Priv_NET^$PRIVATENET^g" "$OUTDIR/$LVS/etc/network/interfaces"
        sed -i "s^Cluster_Public_IP^$CLUSTERIPADDRESS^g" "$OUTDIR/$LVS/etc/network/interfaces"
+
+       eval sed -i "s^Pub_IP^\$LVS0${NUM}_PHYSICAL_PUBLIC_IP^g" "$OUTDIR/$LVS/etc/network/interfaces"
+       eval sed -i "s^Priv_Physical_Address^\$LVS0${NUM}_PRIVATE_IP^g" "$OUTDIR/$LVS/etc/network/interfaces"
+       sed -i "s^LVS01_Private_IP^$LVS01_PRIVATE_IP^g" "$OUTDIR/$LVS/etc/network/interfaces"
+       sed -i "s^LVS02_Private_IP^$LVS02_PRIVATE_IP^g" "$OUTDIR/$LVS/etc/network/interfaces"
+       sed -i "s^Cluster_Private_IP^$LVS01_PRIVATE_SHARED_IP^g" "$OUTDIR/$LVS/etc/network/interfaces"
+       sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" "$OUTDIR/$LVS/etc/network/interfaces"
 done
-sed -i "s^Pub_IP^$LVS01_PHYSICAL_PUBLIC_IP^g" "$OUTDIR/lvs01/etc/network/interfaces"
-sed -i "s^Pub_IP^$LVS02_PHYSICAL_PUBLIC_IP^g" "$OUTDIR/lvs02/etc/network/interfaces"
-sed -i "s^Priv_Physical_Address^$LVS01_PRIVATE_IP^g" "$OUTDIR/lvs01/etc/network/interfaces"
-sed -i "s^Priv_Physical_Address^$LVS02_PRIVATE_IP^g" "$OUTDIR/lvs02/etc/network/interfaces"
+
+
+#sed -i "s^Pub_IP^$LVS01_PHYSICAL_PUBLIC_IP^g" "$OUTDIR/lvs01/etc/network/interfaces"
+#sed -i "s^Pub_IP^$LVS02_PHYSICAL_PUBLIC_IP^g" "$OUTDIR/lvs02/etc/network/interfaces"
+#sed -i "s^Priv_Physical_Address^$LVS01_PRIVATE_IP^g" "$OUTDIR/lvs01/etc/network/interfaces"
+#sed -i "s^Priv_Physical_Address^$LVS02_PRIVATE_IP^g" "$OUTDIR/lvs02/etc/network/interfaces"
+#sed -i "s^LVS01_Private_IP^$LVS01_PRIVATE_IP^g" "$OUTDIR/lvs01/etc/network/interfaces"
+#sed -i "s^LVS02_Private_IP^$LVS02_PRIVATE_IP^g" "$OUTDIR/lvs01/etc/network/interfaces"
+#sed -i "s^LVS01_Private_IP^$LVS01_PRIVATE_IP^g" "$OUTDIR/lvs02/etc/network/interfaces"
+#sed -i "s^LVS02_Private_IP^$LVS02_PRIVATE_IP^g" "$OUTDIR/lvs02/etc/network/interfaces"
+#sed -i "s^Cluster_Private_IP^$LVS01_PRIVATE_SHARED_IP^g" "$OUTDIR/lvs01/etc/network/interfaces"
+#sed -i "s^Cluster_Private_IP^$LVS01_PRIVATE_SHARED_IP^g" "$OUTDIR/lvs02/etc/network/interfaces"
+#sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" "$OUTDIR/lvs01/etc/network/interfaces"
+#sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" "$OUTDIR/lvs02/etc/network/interfaces"
+#TODO add ^^ to loop above.
 
 ### Setup interfaces file all except lvs and bricks.
 SetupInterfaces () { #Configure Interfaces file.
-for NET_NODE in db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01 
+#for NET_NODE in db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01 
+for NET_NODE in $MACHINES_NO_BRICKS_LVS
        do
        cp -f "$TEMPLATEDIR/interfaces" "$OUTDIR/$NET_NODE/etc/network" && \
        eval sed -i "s^Priv_IP^\$${NET_NODE^^*}_IP^g" "$OUTDIR/$NET_NODE/etc/network/interfaces"
+       sed -i "s^LVS01_Private_IP^$LVS01_PRIVATE_IP^g" "$OUTDIR/$NET_NODE/etc/network/interfaces"
+       sed -i "s^LVS02_Private_IP^$LVS02_PRIVATE_IP^g" "$OUTDIR/$NET_NODE/etc/network/interfaces"
+       sed -i "s^Cluster_Private_IP^$LVS01_PRIVATE_SHARED_IP^g" "$OUTDIR/$NET_NODE/etc/network/interfaces"
+       sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" "$OUTDIR/$NET_NODE/etc/network/interfaces"
        sed -i "s^Priv_NET^$PRIVATENET^g" "$OUTDIR/$NET_NODE/etc/network/interfaces"
 done
 }
@@ -1290,28 +1553,32 @@ SetupInterfaces
 
 ### Setup Utility
 ### setup exports for utility.
-cp -f "/tmp/exports" "$OUTDIR/utility01/etc/"
+
+for UTILITY in $MACHINES_UTILITY; do
+cp -f "/tmp/exports" "$OUTDIR/$UTILITY/etc/"
 
 ### action trigger filters for utility.
-mkdir -p "$OUTDIR/utility01/openils/conf"
+mkdir -p "$OUTDIR/$UTILITY/openils/conf"
 if [ -e "$CUSTOMDIR/action_trigger_filters.json" ]
        then
        echo
        echo -e $COL_GREEN"Using custom action trigger filters."$COL_RESET
-       cp -f "$CUSTOMDIR/action_trigger_filters.json" "$OUTDIR/utility01/openils/conf"
+       cp -f "$CUSTOMDIR/action_trigger_filters.json" "$OUTDIR/$UTILITY/openils/conf"
                else
-               cp -f "$TEMPLATEDIR/action_trigger_filters.json" "$OUTDIR/utility01/openils/conf"
+               cp -f "$TEMPLATEDIR/action_trigger_filters.json" "$OUTDIR/$UTILITY/openils/conf"
 fi
 ### copy pines scripts to utility
-mkdir -p "$OUTDIR/utility01/home/opensrf/eg"
-cp $TEMPLATEDIR/utility/*.sh "$OUTDIR/utility01/home/opensrf/eg"
+mkdir -p "$OUTDIR/$UTILITY/home/opensrf/eg"
+cp $TEMPLATEDIR/utility/*.sh "$OUTDIR/$UTILITY/home/opensrf/eg"
+done
 
 ### setup exports for reporter output
 cp -f "/tmp/exports_reporter" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/exports"
 
 
 ### Setup DNS and NTP configs. Except LVS and bricks.
-for DNSNODE in db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01 
+#for DNSNODE in db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01 
+for DNSNODE in $MACHINES_NO_LVS
        do
        cp -f "/tmp/resolv.conf" "$OUTDIR/$DNSNODE/etc"
        cp -f "/tmp/ntp.conf" "$OUTDIR/$DNSNODE/etc"
@@ -1321,7 +1588,8 @@ done
 ### Setup hostname and logger config files on all hosts except bricks.
 echo
 echo "Setting up hostname and logger config files for non-brick nodes.."
-for HOSTNODE in lvs01 lvs02 db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01 
+#for HOSTNODE in lvs01 lvs02 db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01 
+for HOSTNODE in $MACHINES_NO_BRICKS
        do
        echo $HOSTNODE > "$OUTDIR/${HOSTNODE}/etc/hostname"
        cp -f /tmp/rsyslog.conf "$OUTDIR/${HOSTNODE}/etc"
@@ -1330,7 +1598,8 @@ echo "Done setting up hostname and logger config for non-bricks nodes."
 
 
 ### Setup OpenSRF and Evergreen on other OpenSRF Nodes.
-for OTHERNODE in utility01 sip01 sip02 reporter01
+#for OTHERNODE in utility01 sip01 sip02 reporter01
+for OTHERNODE in $MACHINES_OSRF_NO_BRICKS
        do
        mkdir -p "$OUTDIR/$OTHERNODE/var/backup"
        mkdir -p "$OUTDIR/$OTHERNODE/openils/var/data/offline"
@@ -1352,7 +1621,8 @@ for OTHERNODE in utility01 sip01 sip02 reporter01
 done
 
 ### copy completed opensrf file to their respective locations.
-for OSRF_NODE in utility01 sip01 sip02 reporter01
+#for OSRF_NODE in utility01 sip01 sip02 reporter01
+for OSRF_NODE in $MACHINES_OSRF_NO_BRICKS
        do
        cp -f "$TMPOPENSRF_XML" "$OUTDIR/$OSRF_NODE/openils/conf/opensrf.xml"
        cat $TEMPLATEDIR/opensrf.xml/opensrf.xml-footer >> "$OUTDIR/$OTHERNODE/openils/conf/opensrf.xml"
@@ -1362,7 +1632,8 @@ done
 ### Setup SIP
 echo
 echo "Setting up SIP.."
-for SIPNODE in sip01 sip02
+#for SIPNODE in sip01 sip02
+for SIPNODE in $MACHINES_SIP_ONLY
        do
        mkdir -p "$OUTDIR/$SIPNODE/opt"
        mkdir -p "$OUTDIR/$SIPNODE/etc/init.d"
@@ -1382,7 +1653,7 @@ for SIPNODE in sip01 sip02
                                 else
                                 MAINT_PAGE_INDEX="$TEMPLATEDIR/SIP/index.html"
        fi
-       CUSTOM_MAINT_PAGE_INDEX="y" && cp -f $CUSTOMDIR/*.jpg $CUSTOMDIR/*.png "$OUTDIR/$SIPNODE/var/www/"
+       CUSTOM_MAINT_PAGE_INDEX="y" && cp -f $CUSTOMDIR/*.jpg $CUSTOMDIR/*.png "$OUTDIR/$SIPNODE/var/www/" >/dev/null 2>&1
        cp -f $TEMPLATEDIR/SIP/index.html "$OUTDIR/$SIPNODE/var/www"
 done
 echo "Done setting up SIP."
@@ -1392,12 +1663,16 @@ echo "Done setting up SIP."
 ### Setup Logger.
 echo
 echo "Setting up logger"
-mkdir -p "$OUTDIR/logger01/etc/rsyslog.d"
-cp -f "$TEMPLATEDIR/opensrf-rsyslog.conf" "$OUTDIR/logger01/etc/rsyslog.d"
+for LOGGER in $MACHINES_LOGGER
+       do
+       mkdir -p "$OUTDIR/$LOGGER/etc/rsyslog.d"
+       cp -f "$TEMPLATEDIR/opensrf-rsyslog.conf" "$OUTDIR/$LOGGER/etc/rsyslog.d"
+done
 echo "Done setting up logger"
 
 ### Setup DB - !!More stuff to do here for sure.
-for DB_SERVER in db01 db02 db03
+#for DB_SERVER in db01 db02 db03
+for DB_SERVER in $MACHINES_DB_ONLY
        do
        mkdir -p $OUTDIR/${DB_SERVER}/etc/init.d
        mkdir -p $OUTDIR/${DB_SERVER}/etc/postgresql/$PSQL_VERSION/main
@@ -1421,9 +1696,11 @@ for DB_SERVER in db01 db02 db03
 done
 
 ### setup exports for backup 
-cp -f "/tmp/exports_backup" "$OUTDIR/backup01/etc/exports"
-mkdir -p "$OUTDIR/backup01/var/backup"
-
+for BACKUP_SERVER in $MACHINES_BACKUP
+       do
+       cp -f "/tmp/exports_backup" "$OUTDIR/$BACKUP_SERVER/etc/exports"
+       mkdir -p "$OUTDIR/$BACKUP_SERVER/var/backup"
+done
 
 ### Setup system files for the node 
 ### that hosts the reporter exports share
@@ -1432,11 +1709,16 @@ Reports_NFS_Host () {
 ### Setup hosts file
 mkdir -p "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/network" && \
 cp -f "$TMPHOSTS" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/hosts" && \
-sed -i "s^thishost^$HOSTS^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/hosts"
+sed -i "s^thishost^${REPORTS_NFS_HOSTNAME}^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/hosts"
+sed -i "s^${HOSTNAME_PREFIX}-${HOSTNAME_PREFIX}^${HOSTNAME_PREFIX}^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/hosts"
 
 ### Configure interfaces file
 cp -f "$TEMPLATEDIR/interfaces" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/network" && \
-eval sed -i "s^Priv_IP^\$${REPORTS_NFS_HOSTNAME_IP^^*}_IP^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/network/interfaces"
+sed -i "s^Priv_IP^${REPORTS_NFS_HOSTNAME_IP}^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/network/interfaces"
+sed -i "s^Cluster_Private_IP^$LVS01_PRIVATE_SHARED_IP^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/network/interfaces"
+sed -i "s^LVS01_Private_IP^$LVS01_PRIVATE_IP^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/network/interfaces"
+sed -i "s^LVS02_Private_IP^$LVS02_PRIVATE_IP^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/network/interfaces"
+sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/network/interfaces"
 sed -i "s^Priv_NET^$PRIVATENET^g" "$OUTDIR/${REPORTS_NFS_HOSTNAME}/etc/network/interfaces"
 
 ### Configure DNS and NTP
@@ -1473,7 +1755,7 @@ echo "db01 IP Address set to: $DB01_IP" >> "$NETCFGFILE"
 echo "db02 IP Address set to: $DB02_IP" >> "$NETCFGFILE"
 echo "db03 IP Address set to: $DB03_IP" >> "$NETCFGFILE"
 echo >> "$NETCFGFILE"
-echo "** Make sure the database server has a minimum of 128GB RAM" >> "$NETCFGFILE"
+echo "** Make sure the database servers have a minimum of 128GB RAM" >> "$NETCFGFILE"
 echo >> "$NETCFGFILE"
 echo "Utility">> "$NETCFGFILE"
 echo "utility01 IP Address set to: $UTILITY01_IP" >> "$NETCFGFILE"
@@ -1500,13 +1782,15 @@ echo "Memcache" >> "$NETCFGFILE"
 echo "memcache01 IP Address set to: $MEMCACHE01_IP" >> "$NETCFGFILE"
 echo "memcache02 IP Address set to: $MEMCACHE02_IP" >> "$NETCFGFILE"
 echo >> "$NETCFGFILE"
-echo "** Make sure the memcache server has a minimum of 8GB RAM" >> "$NETCFGFILE"
+echo "** Make sure each memcache server has a minimum of 8GB RAM" >> "$NETCFGFILE"
 echo >> "$NETCFGFILE"
 echo >> "$NETCFGFILE"
+echo "monitor01 is for monitoring the cluster." >> "$NETCFGFILE"
 echo "monitor01 IP Address set to: $MONITOR01_IP" >> "$NETCFGFILE"
 echo >> "$NETCFGFILE"
+echo "admin01 is for administrating the cluster." >> "$NETCFGFILE"
 echo "admin01 IP Address set to: $ADMIN01_IP" >> "$NETCFGFILE"
-echo >> "$NETCFGFILE"
+echo >> "$NETCFGFILE" 
 echo >> "$NETCFGFILE"
 echo "Database Username set to: $DB_USERNAME" >> "$NETCFGFILE"
 echo "Database Password set to: $DATABASE_PASSWORD" >> "$NETCFGFILE"
@@ -1602,7 +1886,7 @@ printf " "
 
 
 PkgBricks () { ### Create setup packages for the bricks.
-for FOLDER in $(ls -d brick*)
+for FOLDER in $(ls -d *brick*)
         do
         cd $FOLDER
                 for SUBFOLDER in $(ls -d *)
@@ -1633,8 +1917,11 @@ for FOLDER in $(ls -d brick*)
                                sed -i "s^EG_ADMIN_USER^$EG_ADMIN_USER^g" setup-head.sh
                                sed -i "s^EG_ADMIN_PASS^$EG_ADMIN_PASSWORD^g" setup-head.sh
                        fi
+#TODO check drone pkging. 
                        cp $TEMPLATEDIR/Net-Z3950-SimpleServer-1.12.tar.gz ../setup_${SUBFOLDER}
                        mv setup*.sh ../setup_${SUBFOLDER}/setup_${SUBFOLDER}.sh
+                       mv setup-vars ../setup_${SUBFOLDER}/
+                       mv "setup-functions" ../setup_${SUBFOLDER}/
                         tar zcf ../setup_${SUBFOLDER}/${SUBFOLDER}.tar.gz *
                        tar zcf ../setup_${SUBFOLDER}/${SUBFOLDER}_etc-hosts.tar.gz etc/hosts
                         cd ..
@@ -1655,6 +1942,8 @@ printf " |\r";sleep 0.05; printf " /\r";sleep 0.05; printf -- ' - \r';sleep 0.05
        cd $NODE_FOLDER
        mkdir "setup_${NODE_FOLDER}"
        cp "$TEMPLATEDIR/setup.sh" "setup_${NODE_FOLDER}/setup_$NODE_FOLDER.sh"
+       cp "$TEMPLATEDIR/setup-vars" "setup_${NODE_FOLDER}/setup-vars"
+       cp "$TEMPLATEDIR/setup-functions" "setup_${NODE_FOLDER}/setup-functions"
        if [ -e "$TEMPLATEDIR/apt/${NODE_FOLDER}_apt.list" ]
                then
                 cp "$TEMPLATEDIR/apt/${NODE_FOLDER}_apt.list" "setup_${NODE_FOLDER}"
@@ -1665,7 +1954,7 @@ printf " |\r";sleep 0.05; printf " /\r";sleep 0.05; printf -- ' - \r';sleep 0.05
        cp "/tmp/debconf-settings" "setup_${NODE_FOLDER}" && \
        touch "setup_${NODE_FOLDER}/.osrf_node" && \
        sed -i "s^HOSTNAME^${NODE_FOLDER}^g" "setup_${NODE_FOLDER}/debconf-settings" && \
-       cp -R "$TEMPLATEDIR/debs" "setup_${NODE_FOLDER}" && \
+       cp -R "$TEMPLATEDIR/debs" "setup_${NODE_FOLDER}" 
        #cp $TMPOPENSRF_XML openils/conf/opensrf.xml 
        if echo ${NODE_FOLDER} | grep -q db0
                then
@@ -1682,16 +1971,19 @@ printf " |\r";sleep 0.05; printf " /\r";sleep 0.05; printf -- ' - \r';sleep 0.05
                cp -f "$TEMPLATEDIR/setup_sshkeys.sh" "setup_${NODE_FOLDER}"
                cp -f "$TEMPLATEDIR/utility/opensrf-crontab" "setup_${NODE_FOLDER}"
                cp -f "$TEMPLATEDIR/Net-Z3950-SimpleServer-1.12.tar.gz" "setup_${NODE_FOLDER}"
-               #Optimize_OpenSRF
        fi
        if echo ${NODE_FOLDER} | grep -q sip0
                then
                cp -f "$TEMPLATEDIR/Net-Z3950-SimpleServer-1.12.tar.gz" "setup_${NODE_FOLDER}"
-               #Optimize_OpenSRF
+       fi
+       if echo ${NODE_FOLDER} | grep -q reporter0
+                then
+                cp -f "$TEMPLATEDIR/Net-Z3950-SimpleServer-1.12.tar.gz" "setup_${NODE_FOLDER}"
        fi
        sed -i "s^tar_file^$NODE_FOLDER^g" "setup_${NODE_FOLDER}/setup_$NODE_FOLDER.sh"
-       sed -i "s^_GENVER^$VERSION_^g" "setup_${NODE_FOLDER}/setup_$NODE_FOLDER.sh"
        sed -i "s^_EGVER^$EG_VERSION^g" "setup_${NODE_FOLDER}/setup_$NODE_FOLDER.sh"
+       sed -i "s^_GENVER^$VERSION_^g" "setup_${NODE_FOLDER}/setup-vars"
+       sed -i "s^_EGVER^$EG_VERSION^g" "setup_${NODE_FOLDER}/setup-vars"
        sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" "setup_${NODE_FOLDER}/setup_$NODE_FOLDER.sh"
        mv "$NODE_FOLDER.tar.gz" "setup_${NODE_FOLDER}"
        mv "${NODE_FOLDER}_etc-hosts.tar.gz" "setup_${NODE_FOLDER}"
@@ -1701,17 +1993,21 @@ printf " |\r";sleep 0.05; printf " /\r";sleep 0.05; printf -- ' - \r';sleep 0.05
 #done
 }
 
-# We package the extra host here because of conflicts
 
 cd $OUTDIR
 PkgBricks
 PkgFiles
 #PkgOthers
-for NODE_FOLDER in lvs01 lvs02 db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 backup01 admin01
+
+#All except bricks.
+#for NODE_FOLDER in lvs01 lvs02 db01 db02 db03 logger01 utility01 sip01 sip02 reporter01 memcache01 memcache02 monitor01 backup01 admin01
+for NODE_FOLDER in $MACHINES_NO_BRICKS
        do
        PkgOthers
        printf '. \r'
 done
+
+# We package any extra (dynamic) host here because of conflicts.
 if [ "$ADD_REPORTS_SHARE" = "1" ]
         then
        printf " \n"
@@ -1742,7 +2038,7 @@ if echo $REPORTS_NFS_HOSTNAME | grep -q reporter
 fi
 echo 
 echo -e $COL_BR_YELLOW"_________________________________________________________________________"$COL_RESET
-echo -e $COL_BR_RED "*** Please secure this file as it contains sensitvive information. ***" $COL_RESET
+echo -e $COL_BR_RED "*** Please secure this file as it contains sensitive information. ***" $COL_RESET
 
 
 echo "_______________________Installation Order_______________________" >> "$NETCFGFILE"
index 1e5f876..fa67b7a 100644 (file)
@@ -1,6 +1,13 @@
 ### The DNS domain name for this cluster? eg. gapines.org
 CLUSTERDOMAINNAME="example.org"
 
+### Hostname Prefix
+### If you want to use a hostname prefix such as test or dev
+### for all the hostnames in the cluster then choose y here
+USE_HOSTNAME_PREFIX="y"
+### Enter the hostname prefix below.
+HOSTNAME_PREFIX="test"
+
 ### Use a CA Certificate [y/n]
 USE_CA_CERT="n"
 
@@ -21,7 +28,7 @@ BRICKCOUNT="2"
 
 ### Hostname for the node that will be hosting
 ### the reports output directory eg. reporter01
-REPORTS_NFS_HOSTNAME="storage01"
+CHOSEN_REPORTS_NFS_HOSTNAME="storage01"
 
 ### Password for the user 'opensrf'
 OPENSRF_PASSWORD="change-password"
index ecf1c9f..c0a2827 100644 (file)
@@ -96,7 +96,7 @@ KeepAliveTimeout 1
 # MaxClients: maximum number of server processes allowed to start
 # MaxRequestsPerChild: maximum number of requests a server process serves
 <IfModule mpm_prefork_module>
-    StartServers         20 
+    StartServers         20
     MinSpareServers       5
     MaxSpareServers      15
     MaxClients          150
@@ -105,13 +105,13 @@ KeepAliveTimeout 1
 
 # worker MPM
 # StartServers: initial number of server processes to start
-# MaxClients: maximum number of simultaneous client connections
 # MinSpareThreads: minimum number of worker threads which are kept spare
 # MaxSpareThreads: maximum number of worker threads which are kept spare
 # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
 #              graceful restart. ThreadLimit can only be changed by stopping
 #              and starting Apache.
 # ThreadsPerChild: constant number of worker threads in each server process
+# MaxClients: maximum number of simultaneous client connections
 # MaxRequestsPerChild: maximum number of requests a server process serves
 <IfModule mpm_worker_module>
     StartServers          2
@@ -125,18 +125,18 @@ KeepAliveTimeout 1
 
 # event MPM
 # StartServers: initial number of server processes to start
-# MaxClients: maximum number of simultaneous client connections
 # MinSpareThreads: minimum number of worker threads which are kept spare
 # MaxSpareThreads: maximum number of worker threads which are kept spare
 # ThreadsPerChild: constant number of worker threads in each server process
+# MaxClients: maximum number of simultaneous client connections
 # MaxRequestsPerChild: maximum number of requests a server process serves
 <IfModule mpm_event_module>
     StartServers          2
-    MaxClients          150
     MinSpareThreads      25
     MaxSpareThreads      75 
     ThreadLimit          64
     ThreadsPerChild      25
+    MaxClients          150
     MaxRequestsPerChild   0
 </IfModule>
 
@@ -171,7 +171,14 @@ AccessFileName .htaccess
 # keep browsers from trying to display binary files as though they are
 # text.
 #
-DefaultType text/plain
+# It is also possible to omit any default MIME type and let the
+# client's browser guess an appropriate action instead. Typically the
+# browser will decide based on the file's extension then. In cases
+# where no good assumption can be made, letting the default MIME type
+# unset is suggested  instead of forcing the browser to accept
+# incorrect  metadata.
+#
+DefaultType None
 
 
 #
index cdc9ca8..c9e8df5 100644 (file)
@@ -92,12 +92,12 @@ Alias /updates/ "/openils/var/updates/pub/"
 # OPTIONAL: Set how long the client will cache our content.  Change to suit
 # ----------------------------------------------------------------------------------
 ExpiresActive On
-ExpiresDefault A2592000
-ExpiresByType text/html A64800
-ExpiresByType application/xhtml+xml A64800
-ExpiresByType application/x-javascript A64800
-ExpiresByType application/javascript A64800
-ExpiresByType text/css A3000
+ExpiresDefault "access plus 1 month"
+ExpiresByType text/html "access plus 18 hours"
+ExpiresByType application/xhtml+xml "access plus 18 hours"
+ExpiresByType application/x-javascript "access plus 18 hours"
+ExpiresByType application/javascript "access plus 18 hours"
+ExpiresByType text/css "access plus 50 minutes"
 
 # ----------------------------------------------------------------------------------
 # Set up our SSL virtual host
@@ -109,14 +109,14 @@ NameVirtualHost *:443
        ServerName localhost:443
        ServerAlias 127.0.0.1:443
        SSLEngine on
-       SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+       SSLHonorCipherOrder On
+       SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM
 
     # If you don't have an SSL cert, you can create self-signed 
     # certificate and key with:
     # openssl req -new -x509 -nodes -out server.crt -keyout server.key
        SSLCertificateFile ssl/server.crt
        SSLCertificateKeyFile ssl/server.key
-       #SSLCACertificateFile ssl/ca.crt
 
     # - absorb the shared virtual host settings
     Include eg_vhost.conf
index 379a35d..ea8d662 100644 (file)
@@ -29,6 +29,8 @@ RewriteRule ^/(.*) http://_CLUSTERDOMAINNAME/$1 [L,R]
 #    # OILSRedirectDepth defaults to the depth of the branch that the OPAC was directed to
 #    #PerlSetVar OILSRedirectDepth "0"
 #    #PerlSetVar OILSRedirectLocale "en-US"
+#    # Use the template-toolkit opac
+#    #PerlSetVar OILSRedirectTpac "true"
 #    allow from all
 #</LocationMatch>
 
@@ -58,6 +60,22 @@ OSRFGatewayConfig /openils/conf/opensrf_core.xml
     allow from all
 </Location>
 
+# Autosuggest for searches
+<Location /opac/extras/autosuggest>
+    SetHandler perl-script
+    PerlHandler OpenILS::WWW::AutoSuggest
+    PerlSendHeader On
+    Allow from All
+</Location>
+
+# Flattener service
+<Location /opac/extras/flattener>
+    SetHandler perl-script
+    PerlHandler OpenILS::WWW::FlatFielder
+    PerlSendHeader On
+    Allow from All
+</Location>
+
 # ----------------------------------------------------------------------------------
 # Replace broken cover images with a transparent GIF by default
 # ----------------------------------------------------------------------------------
@@ -78,6 +96,11 @@ RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
 RewriteRule . - [E=locale:%1]
 
 # ----------------------------------------------------------------------------------
+# For sanity reasons, default indexes to Off
+# ----------------------------------------------------------------------------------
+Options -Indexes
+
+# ----------------------------------------------------------------------------------
 # Configure the OPAC
 # ----------------------------------------------------------------------------------
 <LocationMatch /opac/>
@@ -123,16 +146,16 @@ RewriteRule . - [E=locale:%1]
     #SetEnv OILS_CHILIFRESH_ACCOUNT
     #SetEnv OILS_CHILIFRESH_PROFILE
     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
+    #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
 
     # Specify the initial script URL for Novelist (containing account credentials, etc.)
     #SetEnv OILS_NOVELIST_URL
-    
+    #
 
     # Uncomment to force SSL any time a patron is logged in.  This protects 
     # authentication tokens.  Left commented out for backwards compat for now.
     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
 
-
     # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
     #SetEnv OILS_OPAC_COMBINED_JS 1
 
@@ -178,26 +201,6 @@ RewriteRule . - [E=locale:%1]
 
 </Location>
 
-<Location /js/>
-    # ----------------------------------------------------------------------------------
-    # Some mod_deflate fun
-    # ----------------------------------------------------------------------------------
-    <IfModule mod_deflate.c>
-        SetOutputFilter DEFLATE
-
-        BrowserMatch ^Mozilla/4 gzip-only-text/html
-        BrowserMatch ^Mozilla/4\.0[678] no-gzip
-        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
-
-        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
-
-        <IfModule mod_headers.c>
-            Header append Vary User-Agent env=!dont-vary
-        </IfModule>
-    </IfModule>
-
-</Location>
-
 # ----------------------------------------------------------------------------------
 # Force SSL on the OPAC's "My Account" page
 # ----------------------------------------------------------------------------------
@@ -400,10 +403,13 @@ RewriteRule . - [E=locale:en-US]
 # ----------------------------------------------------------------------------------
 <Location /exporter>
     SetHandler perl-script
-    PerlSetVar OILSProxyTitle "Exporter Login"
-    PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
+    AuthType Basic
+    AuthName "Exporter Login"
+    PerlOptions +GlobalRequest
     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
-    PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::Exporter
+    PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+    require valid-user
+    PerlHandler OpenILS::WWW::Exporter
     Options +ExecCGI
     PerlSendHeader On
     allow from all
@@ -411,21 +417,25 @@ RewriteRule . - [E=locale:en-US]
 
 <Location /opac/extras/merge_template>
     SetHandler perl-script
-    PerlSetVar OILSProxyTitle "Batch Update Login"
-    PerlSetVar OILSProxyDescription "Please log in to update records in batch"
+    AuthType Basic
+    AuthName "Batch Update Login"
+    PerlOptions +GlobalRequest
     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
-    PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::TemplateBatchBibUpdate
+    PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+    require valid-user
+    PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
     PerlSendHeader On
     Options +ExecCGI
     allow from all
 </Location>
 
 <Location /opac/extras/circ>
-    SetHandler perl-script
-    PerlSetVar OILSProxyTitle "Circ Extras Login"
-    PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
+    AuthType Basic
+    AuthName "Circ Extras Login"
+    PerlOptions +GlobalRequest
     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
-    PerlHandler OpenILS::WWW::Proxy
+    PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+    require valid-user
     Options +ExecCGI
     PerlSendHeader On
     allow from all
@@ -435,11 +445,12 @@ RewriteRule . - [E=locale:en-US]
 # Reporting output lives here
 # ----------------------------------------------------------------------------------
 <Location /reporter/>
-    SetHandler perl-script
-    PerlSetVar OILSProxyTitle "Report Login"
-    PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to view this report"
+    AuthType Basic
+    AuthName "Report Login"
+    PerlOptions +GlobalRequest
     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
-    PerlHandler OpenILS::WWW::Proxy
+    PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+    require valid-user
     Options +ExecCGI
     PerlSendHeader On
     allow from all
@@ -449,11 +460,12 @@ RewriteRule . - [E=locale:en-US]
 # Selfcheck interface
 # ----------------------------------------------------------------------------------
 <LocationMatch .*/selfcheck.xml>
-    SetHandler perl-script
-    PerlSetVar OILSProxyTitle "Self-check Login"
-    PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to activate the self-check interface"
+    AuthType Basic
+    AuthName "Self-check Login"
+    PerlOptions +GlobalRequest
     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
-    PerlHandler OpenILS::WWW::Proxy
+    PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+    require valid-user
     Options +ExecCGI
     PerlSendHeader On
     allow from all
@@ -511,39 +523,17 @@ RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=local
     XMLEntContentType "text/html; charset=utf-8"
     AddOutputFilter INCLUDES;XMLENT .html
  
-    SetHandler perl-script
-    PerlSetVar OILSProxyTitle "Dojo Admin Login"
-    PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to administer Evergreen"
+    AuthType Basic
+    AuthName "Dojo Admin Login"
+    PerlOptions +GlobalRequest
     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
-    PerlHandler OpenILS::WWW::Proxy
+    PerlAuthenHandler OpenILS::WWW::Proxy::Authen
+    require valid-user
     Options +ExecCGI
     PerlSendHeader On
     allow from all
 </Location>
 
-# ----------------------------------------------------------------------------------
-# Vandelay importers / exporters (your Web interface to bibliographic travel)
-# ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/vandelay/vandelay.xml(.*)$ /vandelay/en-US/vandelay.xml$1
-
-RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
-
-<LocationMatch /vandelay.*xml>
-    XMLEntStripPI "yes"
-    XMLEntEscapeScript "no"
-    XMLEntStripComments "yes"
-    XMLEntContentType "text/html; charset=utf-8"
-    XMLEntStripDoctype "yes"
-    AddOutputFilter INCLUDES;XMLENT .xml
-       SetHandler perl-script
-       PerlSetVar OILSProxyTitle "Vandelay Login"
-       PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to import MARC records"
-       PerlSetVar OILSProxyPermissions "IMPORT_MARC"
-       PerlHandler OpenILS::WWW::Proxy
-       Options +ExecCGI
-       PerlSendHeader On
-       allow from all
-</LocationMatch>
 <Location /vandelay-upload>
     SetHandler perl-script
     PerlHandler OpenILS::WWW::Vandelay::spool_marc
@@ -565,7 +555,73 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     Options +ExecCGI
     PerlSendHeader On
     allow from all
+
+    PerlSetVar OILSWebBasePath "/eg"
+    PerlSetVar OILSWebWebDir "/openils/var/web"
+    PerlSetVar OILSWebDefaultTemplateExtension "tt2"
+
+    # Enable Template-Toolkit error debugging messages (apache error log)
+    PerlSetVar OILSWebDebugTemplate "true"
+
+    # -------------------------------------------------------
+    # Media Prefix.  In the 3rd example, the protocol (http) is enforced
+    #PerlSetVar OILSWebMediaPrefix "/media"
+    #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
+    #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
+
+    # Locale messages files
+    #PerlAddVar OILSWebLocale "en"
+    #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
+    #PerlAddVar OILSWebLocale "en_ca"
+    #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en_ca.po"
+    #PerlAddVar OILSWebLocale "fr_ca"
+    #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.fr_ca.po"
+
+    # Templates will be loaded from the following paths in reverse order.
+    PerlAddVar OILSWebTemplatePath "/openils/var/templates"
+    #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
+
+    <IfModule mod_deflate.c>
+        SetOutputFilter DEFLATE
+        BrowserMatch ^Mozilla/4 gzip-only-text/html
+        BrowserMatch ^Mozilla/4\.0[678] no-gzip
+        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+        <IfModule mod_headers.c>
+            Header append Cache-Control "public"
+            Header append Vary User-Agent env=!dont-vary
+        </IfModule>
+    </IfModule>
 </Location>
+<LocationMatch ^/(images|css|js)/>
+    # should pick up the default expire time from eg.conf...
+    <IfModule mod_deflate.c>
+        SetOutputFilter DEFLATE
+        BrowserMatch ^Mozilla/4 gzip-only-text/html
+        BrowserMatch ^Mozilla/4\.0[678] no-gzip
+        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+        <IfModule mod_headers.c>
+            Header append Cache-Control "public"
+            Header append Vary User-Agent env=!dont-vary
+        </IfModule>
+    </IfModule>
+</LocationMatch>
+<Location /eg/opac>
+    PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
+    # Expire the HTML quickly since we're loading dynamic data for each page
+    ExpiresActive On
+    ExpiresByType text/html "access plus 5 seconds"
+    
+    # For use with embedded Content Cafe content
+    #SetEnv OILS_CONTENT_CAFE_USER 123
+    #SetEnv OILS_CONTENT_CAFE_PASS 456
+    # Consider copying/moving other added content configs 
+    # (e.g. NOVELIST) into here or to an outer container shared by
+    # both /opac and /eg/opac since some are used in both places
+</Location>
+
+
 # Note: the template processor will decline handling anything it does not
 # have an explicit configuration for, which means it will fall back to 
 # Apache to serve the file.  However, in the interest of speed, go ahead 
@@ -631,7 +687,3 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
 # and you will suffer a performance hit.
 #RewriteCond %{HTTPS} off
 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
-
-#copied to the bottom of this file from eg.conf
-CustomLog "|/usr/bin/logger -p local7.info" common
-ErrorLog syslog:local7
index 6f1a742..f7755b6 100755 (executable)
@@ -1,13 +1,19 @@
 #!/usr/bin/perl
+use OpenSRF::AppSession;
+
+# default ingress value for all Apache/mod_perl clients
+OpenSRF::AppSession->ingress('apache'); 
+
 use OpenILS::WWW::Exporter qw( /openils/conf/opensrf_core.xml );
 use OpenILS::WWW::SuperCat qw( /openils/conf/opensrf_core.xml );
 use OpenILS::WWW::AddedContent qw( /openils/conf/opensrf_core.xml );
 use OpenILS::WWW::Proxy ('/openils/conf/opensrf_core.xml');
 use OpenILS::WWW::Vandelay qw( /openils/conf/opensrf_core.xml );
 use OpenILS::WWW::TemplateBatchBibUpdate qw( /openils/conf/opensrf_core.xml );
-use OpenILS::WWW::EGWeb ('/openils/conf/oils_web.xml');
+use OpenILS::WWW::EGWeb;
 use OpenILS::WWW::PasswordReset ('/openils/conf/opensrf_core.xml');
 use OpenILS::WWW::IDL2js ('/openils/conf/opensrf_core.xml');
+use OpenILS::WWW::FlatFielder;
 
 # - Uncoment the following 2 lines to make use of the IP redirection code
 # - The IP file should to contain a map with the following format:
diff --git a/templates/apt/monitor01_apt.list b/templates/apt/monitor01_apt.list
new file mode 100644 (file)
index 0000000..df144e7
--- /dev/null
@@ -0,0 +1 @@
+ntp gdebi-core ssh nfs-kernel-server icinga
diff --git a/templates/debs/evergreen-ils_2.3.1_amd64.deb b/templates/debs/evergreen-ils_2.3.1_amd64.deb
new file mode 100644 (file)
index 0000000..a53dc27
Binary files /dev/null and b/templates/debs/evergreen-ils_2.3.1_amd64.deb differ
diff --git a/templates/debs/libclass-dbi-frozen-301_3.0.1-1_amd64.deb b/templates/debs/libclass-dbi-frozen-301_3.0.1-1_amd64.deb
new file mode 100644 (file)
index 0000000..006c7ad
Binary files /dev/null and b/templates/debs/libclass-dbi-frozen-301_3.0.1-1_amd64.deb differ
diff --git a/templates/debs/opensrf_2.1.1_amd64.deb b/templates/debs/opensrf_2.1.1_amd64.deb
new file mode 100644 (file)
index 0000000..c849037
Binary files /dev/null and b/templates/debs/opensrf_2.1.1_amd64.deb differ
diff --git a/templates/debs/spidermonkey-perl_0.21-1_amd64.deb b/templates/debs/spidermonkey-perl_0.21-1_amd64.deb
new file mode 100644 (file)
index 0000000..fda8480
Binary files /dev/null and b/templates/debs/spidermonkey-perl_0.21-1_amd64.deb differ
index f5369e9..6b138b8 100644 (file)
@@ -8,7 +8,5 @@
 #45 1 * * * find /var/log/evergreen -not -name activity.* -not -name ap_access.* -type f -ctime +180 -exec rm {} \;
 
 MAILTO=pines-tech@list.georgialibraries.org
-30 6 * * * /root/processing_count.sh circ
-31 6 * * * /root/processing_count.sh hold
 
-# 0 * * * * /etc/init.d/syslog-ng restart # why did the do this?
+
diff --git a/templates/hosts-footer-prefixed b/templates/hosts-footer-prefixed
new file mode 100644 (file)
index 0000000..adfe179
--- /dev/null
@@ -0,0 +1,22 @@
+Priv_NET.101   PREFIX-db01.sampledomain.org PREFIX-db01
+Priv_NET.102   PREFIX-db02.sampledomain.org PREFIX-db02
+Priv_NET.103   PREFIX-db03.sampledomain.org PREFIX-db03
+Priv_NET.111   PREFIX-utility01.sampledomain.org public.PREFIX-utility01.sampledomain.org private.PREFIX-utility01.sampledomain.org PREFIX-utility01
+Priv_NET.121   PREFIX-logger01.sampledomain.org PREFIX-logger01
+Priv_NET.131   PREFIX-sip01.sampledomain.org public.PREFIX-sip01.sampledomain.org private.PREFIX-sip01.sampledomain.org PREFIX-sip01
+Priv_NET.132   PREFIX-sip02.sampledomain.org public.PREFIX-sip02.sampledomain.org private.PREFIX-sip02.sampledomain.org PREFIX-sip02
+Priv_NET.141   PREFIX-reporter01.sampledomain.org PREFIX-reporter01
+Priv_NET.151   PREFIX-memcache01.sampledomain.org PREFIX-memcache01
+Priv_NET.152   PREFIX-memcache02.sampledomain.org PREFIX-memcache02
+Priv_NET.171   PREFIX-backup01.sampledomain.org PREFIX-backup01
+Priv_NET.201   PREFIX-monitor01.sampledomain.org PREFIX-monitor01
+Priv_NET.211   PREFIX-admin01.sampledomain.org PREFIX-admin01
+
+# The following lines are desirable for IPv6 capable hosts
+::1     localhost ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+ff02::3 ip6-allhosts
+
diff --git a/templates/hosts-header-prefixed b/templates/hosts-header-prefixed
new file mode 100644 (file)
index 0000000..6fe4da5
--- /dev/null
@@ -0,0 +1,3 @@
+127.0.0.1       localhost
+127.0.1.1       PREFIX-thishost.sampledomain.org       PREFIX-thishost
+#OPENSRF_DEB Addresses
index fb515f5..cbcd13b 100644 (file)
                 <appname>open-ils.circ</appname>
                 <appname>open-ils.actor</appname>
                 <appname>open-ils.auth</appname>
+                <appname>open-ils.auth_proxy</appname>
                 <appname>open-ils.storage</appname>
                 <appname>open-ils.penalty</appname>
+                <!-- <appname>open-ils.justintime</appname> -->
                 <appname>open-ils.cstore</appname>
                 <appname>open-ils.collections</appname>
                 <appname>open-ils.ingest</appname>
index bb94797..f6cc632 100644 (file)
                 <appname>open-ils.circ</appname>
                 <appname>open-ils.actor</appname>
                 <appname>open-ils.auth</appname>
+                <appname>open-ils.auth_proxy</appname>
                 <appname>open-ils.storage</appname>
                 <appname>open-ils.penalty</appname>
+                <!-- <appname>open-ils.justintime</appname> -->
                 <appname>open-ils.cstore</appname>
                 <appname>open-ils.collections</appname>
                 <appname>open-ils.ingest</appname>
index 32aab9f..38a94c2 100644 (file)
@@ -39,7 +39,7 @@ vim:et:ts=4:sw=4:
         <email_notify> <!-- this will eventually move into the notifications section below... -->
             <!-- global email notification settings -->
             <template>/openils/var/data/hold_notification_template.example</template>
-            <smtp_server>ClusterDomainName</smtp_server>
+            <smtp_server>lvs01.ClusterDomainName</smtp_server>
 
             <!--
             in most cases, this is overridden by location 
@@ -51,7 +51,7 @@ vim:et:ts=4:sw=4:
 
       <notifications>
         <!-- global mail server settings -->
-        <smtp_server>ClusterDomainName</smtp_server>
+        <smtp_server>lvs01.ClusterDomainName</smtp_server>
         <sender_address>evergreen@ClusterDomainName</sender_address>
 
         <!-- global telephony (asterisk) settings -->
@@ -135,13 +135,13 @@ vim:et:ts=4:sw=4:
                  hold requests, but with diminishing returns after a point;
                  if increasing this value, it is recommend to do so slowly
             -->
-            <parallel>4</parallel>
+            <parallel>1</parallel>
         </hold_targeter>
 
         <!-- Settings for the fine generator cron job -->
         <fine_generator>
             <!-- number of parallel processes to use during fine generation -->
-            <parallel>4</parallel>
+            <parallel>1</parallel>
         </fine_generator>
         
         <reporter>
@@ -152,7 +152,7 @@ vim:et:ts=4:sw=4:
                 <base_uri>https://ClusterDomainName/reporter/</base_uri>
                 <database>
                     <driver>Pg</driver>
-                    <host>db03.ClusterDomainName</host>
+                    <host>db01.ClusterDomainName</host>
                     <port>5432</port>
                     <db>evergreen</db>
                     <user>evergreen</user>
@@ -188,47 +188,22 @@ vim:et:ts=4:sw=4:
                 <service>open-ils.circ</service>
                 <service>open-ils.actor</service>
                 <service>open-ils.auth</service>
+                <service>open-ils.auth_proxy</service>
                 <service>open-ils.collections</service>
+                <service>open-ils.justintime</service>
             </allowed_services>
         </xml-rpc>
 
-
-        <z3950>
-            <default>oclc</default>
-            <services>
-                
-               <oclc>
-                    <!-- Z3950 settings for OCLC.  Note that OCLC requires username/password -->
-                    <host>zcat.oclc.org</host>
-                    <port>210</port>
-                    <db>OLUCWorldCat</db>
-                    <attrs>
-                        <!--
-                        These are directly from the Bib-1 Attribute Set
-                        http://www.loc.gov/z3950/agency/defns/bib1.html
-                        <code> is the "use attribute", <format> is the "structure attribute"
-                        This just puts some friendly names on the data.
-                        -->
-                        <tcn><code>12</code><format>1</format></tcn>
-                        <isbn><code>7</code><format>6</format></isbn>
-                        <lccn><code>9</code><format>1</format></lccn>
-                        <author><code>1003</code><format>6</format></author>
-                        <title><code>4</code><format>6</format></title>
-                        <issn><code>8</code><format>1</format></issn>
-                        <publisher><code>1018</code><format>6</format></publisher>
-                        <pubdate><code>31</code><format>1</format></pubdate>
-                        <item_type><code>1001</code><format>1</format></item_type>
-                    </attrs>
-                </oclc>
-
-            </services>
-        </z3950>
-
+        <!--
+        Once upon a time, Z39.50 servers were defined here. As of Evergreen 2.2,
+        they are now defined in the database. See the Release Notes for
+        instructions on mapping the old XML entries to database tables.
+        -->
 
         <added_content>
             <!-- load the OpenLibrary added content module -->
-            <module>OpenILS::WWW::AddedContent::Syndetic</module>
-           <base_url>http://syndetics.com/index.aspx</base_url>
+            <module>OpenILS::WWW::AddedContent::OpenLibrary</module>
+
             <!--
             Max number of seconds to wait for an added content request to 
             return data.  Data not returned within the timeout is considered
@@ -247,7 +222,7 @@ vim:et:ts=4:sw=4:
             service and the enhanced user experience offered by successful added
             content requests.
             -->
-            <timeout>1</timeout>
+            <timeout>3</timeout>
 
             <!--
             After added content lookups have been disabled due to too many
@@ -263,7 +238,7 @@ vim:et:ts=4:sw=4:
             <max_errors>15</max_errors>
 
             <!-- If a userid is required to access the added content.. -->
-            <userid>evertest</userid>
+            <userid>MY_USER_ID</userid>
 
             <!--
             Base URL for Amazon added content fetching. Not needed by OpenLibrary
@@ -274,17 +249,17 @@ vim:et:ts=4:sw=4:
             Segregating the details for ContentCafe out for easier use.  At some point, we
             may want to support multiple services at one time.
             -->
-            <!-- <ContentCafe>
+            <ContentCafe>
                 <userid>MY_USER_ID</userid>
-                <password>MY_PASSWORD</password> -->
+                <password>MY_PASSWORD</password>
 
                 <!--
                 If no cover/jacket image exists for a given ISBN, then a value of T here will
                 return an 80x120 pixel image containing the text "No Image Available".  A
                 value of 1 will return a 1x1 pixel image.
                 -->
-                <!-- <return_behavior_on_no_jacket_image>T</return_behavior_on_no_jacket_image>
-            </ContentCafe> -->
+                <return_behavior_on_no_jacket_image>T</return_behavior_on_no_jacket_image>
+            </ContentCafe>
 
             <!--
  
@@ -294,6 +269,54 @@ vim:et:ts=4:sw=4:
 
         </added_content>
 
+        <!-- Config section for acq_order_reader.pl script.
+             It reads MARC order record files from disk (presumably
+             an FTP destination) and pushes the order records into ACQ.
+             THIS IS NOT EDI. -->
+        <acq_order_reader>
+
+            <!-- Root directory for all FTP'd ACQ order record files .
+                 If the script is configured to talk to a remote acq server,
+                 this directory has to be a read/write NFS share.  -->
+            <base_dir>/openils/var/data/acq_orders/</base_dir>
+
+            <!-- any files found in the shared subdir must be inspected
+                 (e.g. file name prefix) to determine the provider. -->
+            <shared_subdir>ALL</shared_subdir><!-- SUPPORT PENDING -->
+
+            <!-- providers that don't provide a mechanism to inspect the file
+                 have to push their files to provider-specific locations -->
+            <provider>
+                <ordering_agency>BR1</ordering_agency> <!-- who gets/manages the order -->
+                <provider_code>BAB</provider_code>   
+                <provider_owner>CONS</provider_owner>  <!-- provider provider_owner; org unit shortname -->
+                <subdir>CONS-BAB</subdir> <!-- file directory;  full path = base_dir + subdir -->
+                <activate_po>false</activate_po> <!-- activate PO at upload? -->
+                <vandelay>
+                    <import_no_match>true</import_no_match>
+                    <!-- Most Vandelay options are supported.  For bools, use true/false.
+                        match_quality_ratio 
+                        match_set 
+                        bib_source 
+                        merge_profile
+                        create_assets
+                        import_no_match 
+                        auto_overlay_exact 
+                        auto_overlay_1match 
+                        auto_overlay_best_match
+                    -->
+                </vandelay>
+            </provider>
+
+            <!-- Add more as needed...
+            <provider>
+                ...
+            </provider>
+            -->
+
+        </acq_order_reader>
+
+
         <!-- no apps are enabled globally by default -->
         <activeapps/> 
 
@@ -387,6 +410,58 @@ vim:et:ts=4:sw=4:
                 </app_settings>
             </open-ils.auth>
 
+            <!-- Authentication proxy server -->
+            <open-ils.auth_proxy>
+                <keepalive>5</keepalive>
+                <stateless>1</stateless>
+                <language>perl</language>
+                <implementation>OpenILS::Application::AuthProxy</implementation>
+                <max_requests>93</max_requests>
+
+                <unix_config>
+                    <max_requests>1000</max_requests>
+                    <unix_log>open-ils.auth-proxy_unix.log</unix_log>
+                    <unix_sock>open-ils.auth-proxy_unix.sock</unix_sock>
+                    <unix_pid>open-ils.auth-proxy_unix.pid</unix_pid>
+                    <min_children>1</min_children>
+                    <max_children>15</max_children>
+                    <min_spare_children>1</min_spare_children>
+                    <max_spare_children>5</max_spare_children>
+                </unix_config>
+
+                <app_settings>
+                    <!-- 'enabled' is the master switch; set to 'true' to enable proxied logins -->
+                    <enabled>false</enabled>
+                    <authenticators>
+                        <!-- the following is a sample configuration for the LDAP_Auth module; please adjust as needed -->
+                        <!--
+                        <authenticator>
+                            <name>ldap</name>
+                            <module>OpenILS::Application::AuthProxy::LDAP_Auth</module>
+                            <hostname>name.domain.com</hostname>
+                            <basedn>ou=people,dc=domain,dc=com</basedn>
+                            <authid>cn=username,ou=specials,dc=domain,dc=com</authid>
+                            <id_attr>uid</id_attr>
+                            <password>my_ldap_password_for_authid_user</password>
+                            <login_types>
+                                <type>staff</type>
+                                <type>opac</type>
+                            </login_types>
+                            <org_units>
+                                <unit>103</unit>
+                                <unit>104</unit>
+                            </org_units>
+                        </authenticator>
+                        -->
+                        <!-- 'native' is a proxied version of Evergreen's standard authentication -->
+                        <authenticator>
+                            <name>native</name>
+                            <!-- you can add 'login_types' and 'org_units' limits to this authenticator as well, if needed -->
+                        </authenticator>
+                    </authenticators>
+                </app_settings>
+            </open-ils.auth_proxy>
+
             <!-- Generic search server -->
             <open-ils.search>
                 <keepalive>5</keepalive>
@@ -401,7 +476,7 @@ vim:et:ts=4:sw=4:
 
                     <max_requests>1000</max_requests>
                     <min_children>1</min_children>
-                    <max_children>search_MAX</max_children>
+                    <max_children>15</max_children>
                     <min_spare_children>1</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -525,7 +600,7 @@ vim:et:ts=4:sw=4:
                     <max_requests>1000</max_requests>
                     <unix_log>open-ils.actor_unix.log</unix_log>
                     <min_children>1</min_children>
-                    <max_children>actor_MAX</max_children>
+                    <max_children>15</max_children>
                     <min_spare_children>1</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -536,7 +611,6 @@ vim:et:ts=4:sw=4:
 
             </open-ils.actor>
 
-<!--
             <open-ils.booking>
                 <keepalive>5</keepalive>
                 <stateless>1</stateless>
@@ -556,7 +630,6 @@ vim:et:ts=4:sw=4:
                 <app_settings>
                 </app_settings>
             </open-ils.booking>
--->
 
             <open-ils.cat>
                 <keepalive>5</keepalive>
@@ -570,7 +643,7 @@ vim:et:ts=4:sw=4:
                     <max_requests>1000</max_requests>
                     <unix_log>open-ils.cat_unix.log</unix_log>
                     <min_children>1</min_children>
-                    <max_children>cata_MAX</max_children>
+                    <max_children>15</max_children>
                     <min_spare_children>1</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -593,7 +666,7 @@ vim:et:ts=4:sw=4:
                     <max_requests>1000</max_requests>
                     <unix_log>open-ils.supercat_unix.log</unix_log>
                     <min_children>1</min_children>
-                    <max_children>supercat_MAX</max_children>
+                    <max_children>15</max_children>
                     <min_spare_children>1</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -618,12 +691,12 @@ vim:et:ts=4:sw=4:
                 </unix_config>
                 <app_settings>
                     <!-- number of parallel open-ils.trigger processes to use for collection and reaction -->
-                    
+                    <!--
                     <parallel>
                         <collect>3</collect>
                         <react>3</react>
                     </parallel>
-                   
+                    -->
                 </app_settings>
             </open-ils.trigger>
 
@@ -673,7 +746,7 @@ vim:et:ts=4:sw=4:
                     <unix_sock>open-ils.penalty_unix.sock</unix_sock>
                     <unix_pid>open-ils.penalty_unix.pid</unix_pid>
                     <min_children>1</min_children>
-                    <max_children>penalty_MAX</max_children>
+                    <max_children>15</max_children>
                     <min_spare_children>1</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -685,6 +758,26 @@ vim:et:ts=4:sw=4:
                 </app_settings>
             </open-ils.penalty>
 
+            <open-ils.justintime>
+                <keepalive>5</keepalive>
+                <stateless>1</stateless>
+                <language>perl</language>
+                <implementation>OpenILS::Application::JustInTime</implementation>
+                <max_requests>199</max_requests>
+                <unix_config>
+                    <unix_sock>open-ils.justintime_unix.sock</unix_sock>
+                    <unix_pid>open-ils.justintime_unix.pid</unix_pid>
+                    <max_requests>1000</max_requests>
+                    <unix_log>open-ils.justintime_unix.log</unix_log>
+                    <min_children>1</min_children>
+                    <max_children>15</max_children>
+                    <min_spare_children>1</min_spare_children>
+                    <max_spare_children>5</max_spare_children>
+                </unix_config>
+                <app_settings>
+                </app_settings>
+            </open-ils.justintime>
+
             <open-ils.circ> 
                 <keepalive>3</keepalive>
                 <stateless>1</stateless>
@@ -697,7 +790,7 @@ vim:et:ts=4:sw=4:
                     <unix_sock>open-ils.circ_unix.sock</unix_sock>
                     <unix_pid>open-ils.circ_unix.pid</unix_pid>
                     <min_children>1</min_children>
-                    <max_children>circ_MAX</max_children>
+                    <max_children>15</max_children>
                     <min_spare_children>1</min_spare_children> 
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -794,7 +887,7 @@ vim:et:ts=4:sw=4:
                     <unix_sock>open-ils.ingest-unix.sock</unix_sock>
                     <unix_pid>open-ils.ingest-unix.pid</unix_pid>
                     <min_children>5</min_children>
-                    <max_children>ingest_MAX</max_children>
+                    <max_children>20</max_children>
                     <min_spare_children>2</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -820,7 +913,7 @@ vim:et:ts=4:sw=4:
                     <unix_sock>open-ils.storage_unix.sock</unix_sock>
                     <unix_pid>open-ils.storage_unix.pid</unix_pid>
                     <min_children>1</min_children>
-                    <max_children>storage_MAX</max_children>
+                    <max_children>10</max_children>
                     <min_spare_children>1</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -854,7 +947,7 @@ vim:et:ts=4:sw=4:
                 <unix_config>
                     <max_requests>1000</max_requests>
                     <min_children>1</min_children>
-                    <max_children>cstore_MAX</max_children>
+                    <max_children>15</max_children>
                     <min_spare_children>1</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -969,6 +1062,10 @@ vim:et:ts=4:sw=4:
                     <min_spare_children>1</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
+                <app_settings>
+                    <!-- batch_file_dir must be a protected, web-accessible, shared directory -->
+                    <batch_file_dir>/openils/var/web/collections</batch_file_dir>
+                </app_settings>
             </open-ils.collections>
 
             <open-ils.reporter>
@@ -1016,6 +1113,7 @@ vim:et:ts=4:sw=4:
                 </app_settings>
             </open-ils.reporter-store>
 
+<!-- resolver_type defaults to sfx but can also be cufts -->
 <!--
            <open-ils.resolver>
                <keepalive>3</keepalive>
@@ -1035,7 +1133,9 @@ vim:et:ts=4:sw=4:
                </unix_config>
                <app_settings>
                   <cache_timeout>86400</cache_timeout>
-                  <default_url_base>http://path/to/sfx</default_url_base>
+                  <request_timeout>10</request_timeout>
+                  <default_url_base>http://path/to/sfx_or_cufts</default_url_base>
+                  <resolver_type>sfx</resolver_type>
                </app_settings>
             </open-ils.resolver>
 -->
@@ -1052,7 +1152,7 @@ vim:et:ts=4:sw=4:
                   <max_requests>1000</max_requests>
                   <unix_log>open-ils.permacrud_unix.log</unix_log>
                   <min_children>5</min_children>
-                  <max_children>permacrud_MAX</max_children>
+                  <max_children>15</max_children>
                   <min_spare_children>3</min_spare_children>
                   <max_spare_children>5</max_spare_children>
                </unix_config>
@@ -1070,7 +1170,7 @@ vim:et:ts=4:sw=4:
                   <max_requests>1000</max_requests>
                   <unix_log>open-ils.fielder_unix.log</unix_log>
                   <min_children>5</min_children>
-                  <max_children>fielder_MAX</max_children>
+                  <max_children>15</max_children>
                   <min_spare_children>3</min_spare_children>
                   <max_spare_children>5</max_spare_children>
                </unix_config>
@@ -1088,7 +1188,7 @@ vim:et:ts=4:sw=4:
                     <unix_log>vandelay_unix.log</unix_log>
                     <max_requests>100</max_requests>
                     <min_children>1</min_children>
-                    <max_children>vandelay_MAX</max_children>
+                    <max_children>15</max_children>
                     <min_spare_children>1</min_spare_children>
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
@@ -1098,7 +1198,7 @@ vim:et:ts=4:sw=4:
                             Files will be deleted after records are spooled.
                             *note:  in a multi-brick environment, this will need to
                             be on a write-able NFS share.  -->
-                        <importer>/openils/var/data/offline/vandelay</importer>
+                        <importer>/tmp</importer>
                     </databases>
                 </app_settings>
             </open-ils.vandelay>
index fe5a178..af3cfd3 100644 (file)
@@ -1 +1,3 @@
 updated to 2.1.0 Wed Oct 19 12:54:14 EDT 2011
+Updated to 2.2beta Tue May  8 03:46:47 EDT 2012
+Updated to 2.3rc1 on Mon Sep 10 09:57:52 EDT 2012
index 5a5c8f2..01737c4 100644 (file)
@@ -15,14 +15,15 @@ Example OpenSRF bootstrap configuration file for Evergreen
           network
         -->
         <name>router</name>
-        <domain>public.Brick_head_Fqdn</domain>
+        <domain>public.localhost</domain>
 
         <services>
           <service>opensrf.math</service>
           <service>open-ils.actor</service>
           <service>open-ils.acq</service>
           <service>open-ils.auth</service>
-          <!-- <service>open-ils.booking</service> -->
+          <service>open-ils.auth_proxy</service>
+          <service>open-ils.booking</service>
           <service>open-ils.cat</service>
           <service>open-ils.circ</service>
           <service>open-ils.collections</service>
@@ -30,7 +31,7 @@ Example OpenSRF bootstrap configuration file for Evergreen
           <service>open-ils.pcrud</service>
           <service>open-ils.permacrud</service>
           <service>open-ils.reporter</service>
-          <!-- <service>open-ils.resolver</service> -->
+          <service>open-ils.resolver</service>
           <service>open-ils.search</service>
           <service>open-ils.supercat</service>
           <service>open-ils.vandelay</service>
@@ -44,12 +45,12 @@ Example OpenSRF bootstrap configuration file for Evergreen
           this router, so no explicit <services> section is required
         -->
         <name>router</name>
-        <domain>private.Brick_head_Fqdn</domain>
+        <domain>private.localhost</domain>
       </router>
     </routers>
 
     <!-- Our domain should match that of the private router -->
-    <domain>private.Brick_head_Fqdn</domain>
+    <domain>private.localhost</domain>
     <username>opensrf</username>
     <passwd>OpenSRF_Password</passwd>
     <port>5222</port>
@@ -60,10 +61,12 @@ Example OpenSRF bootstrap configuration file for Evergreen
      -->
     <router_name>router</router_name>
 
-    <!-- <logfile>/openils/var/log/osrfsys.log</logfile> -->
+    <logfile>/openils/var/log/osrfsys.log</logfile>
+    <!--
       <logfile>syslog</logfile>
       <syslog>local0</syslog>
       <actlog>local1</actlog>
+     -->
     <loglevel>3</loglevel>
     <settings_config>/openils/conf/opensrf.xml</settings_config>
   </opensrf>
@@ -76,7 +79,7 @@ Example OpenSRF bootstrap configuration file for Evergreen
     <router_name>router</router_name>
 
     <!-- The gateway connects to the public domain for security -->
-    <domain>public.Brick_head_Fqdn</domain>
+    <domain>public.localhost</domain>
 
     <!-- This section will be soon deprecated for multi-domain mode... -->
     <services>
@@ -87,6 +90,7 @@ Example OpenSRF bootstrap configuration file for Evergreen
       <service>open-ils.circ</service>
       <service>open-ils.actor</service>
       <service>open-ils.auth</service>
+      <service>open-ils.auth_proxy</service>
       <service>open-ils.collections</service>
       <service>open-ils.reporter</service>
     </services>
@@ -96,10 +100,12 @@ Example OpenSRF bootstrap configuration file for Evergreen
     <passwd>OpenSRF_Password</passwd>
     <port>5222</port>
     <loglevel>3</loglevel>
-    <!-- <logfile>/openils/var/log/gateway.log</logfile> -->
+    <logfile>/openils/var/log/gateway.log</logfile>
+    <!--
       <logfile>syslog</logfile>
       <syslog>local6</syslog>
       <actlog>local1</actlog>
+    -->
   </gateway>
   <!-- ======================================================================================== -->
   <routers>
@@ -110,18 +116,18 @@ Example OpenSRF bootstrap configuration file for Evergreen
           Allow private services to register with this router 
           and public client to send requests to this router. 
         -->
-        <server>private.Brick_head_Fqdn</server>
+        <server>private.localhost</server>
 
         <!-- 
           Also allow private clients to send to the router so it
           can receive error messages
         -->
-        <client>private.Brick_head_Fqdn</client>
-        <client>public.Brick_head_Fqdn</client>
+        <client>private.localhost</client>
+        <client>public.localhost</client>
 
       </trusted_domains>
       <transport>
-        <server>public.Brick_head_Fqdn</server>
+        <server>public.localhost</server>
         <port>5222</port>
         <unixpath>/openils/var/sock/unix_sock</unixpath>
         <username>router</username>
@@ -130,22 +136,24 @@ Example OpenSRF bootstrap configuration file for Evergreen
         <connect_timeout>10</connect_timeout>
         <max_reconnect_attempts>5</max_reconnect_attempts>
       </transport>
-      <!-- <logfile>/openils/var/log/router-public.log</logfile> -->
+      <logfile>/openils/var/log/router-public.log</logfile>
+      <!--
         <logfile>syslog</logfile>
         <syslog>local2</syslog>
+      -->
       <loglevel>2</loglevel>
     </router>
     <router>
       <!-- private router -->
       <trusted_domains>
-        <server>private.Brick_head_Fqdn</server>
+        <server>private.localhost</server>
         <!-- 
           Only clients on the private domain can send requests to this router
          -->
-        <client>private.Brick_head_Fqdn</client>
+        <client>private.localhost</client>
       </trusted_domains>
       <transport>
-        <server>private.Brick_head_Fqdn</server>
+        <server>private.localhost</server>
         <port>5222</port>
         <username>router</username>
         <password>OpenSRF_Password</password>
@@ -153,9 +161,11 @@ Example OpenSRF bootstrap configuration file for Evergreen
         <connect_timeout>10</connect_timeout>
         <max_reconnect_attempts>5</max_reconnect_attempts>
       </transport>
-      <!-- <logfile>/openils/var/log/router-private.log</logfile> -->
+      <logfile>/openils/var/log/router-private.log</logfile>
+      <!--
         <logfile>syslog</logfile>
         <syslog>local2</syslog>
+      -->
       <loglevel>2</loglevel>
     </router>
   </routers>
index cf3d0d3..9e07d5f 100755 (executable)
@@ -3,33 +3,8 @@
 #TODO: export GenaSYS version to install logs.
 
 WD=$(dirname $(readlink -f $0))
-EG_VER="_EGVER"
-VERSION="_GENVER"
-
-### Setup colors.
-## Normal colors.
-ESC_SEQ="\x1b["
-COL_RESET=$ESC_SEQ"39;49;00m"
-COL_RED=$ESC_SEQ"0;31m"
-COL_GREEN=$ESC_SEQ"0;32m"
-COL_YELLOW=$ESC_SEQ"0;33m"
-COL_BLUE=$ESC_SEQ"0;34m"
-COL_MAGENTA=$ESC_SEQ"0;35m"
-COL_CYAN=$ESC_SEQ"0;36m"
-
-## Bright colors.
-COL_BR_RED=$ESC_SEQ"1;31m"
-COL_BR_GREEN=$ESC_SEQ"1;32m"
-COL_BR_YELLOW=$ESC_SEQ"1;33m"
-COL_BR_BLUE=$ESC_SEQ"1;34m"
-COL_BR_MAGENTA=$ESC_SEQ"1;35m"
-COL_BR_CYAN=$ESC_SEQ"1;36m"
-
-if [ "$(id -u)" != "0" ] # Check if we are root
-        then 
-        echo "You must be root to setup Evergreen $EG_VER"
-        exit 1
-fi
+. "$WD/setup-vars"
+. "$WD/setup-functions"
 
 if [ ! -e drone_file.tar.gz ] # Check if config files exist
         then
@@ -51,7 +26,6 @@ if [ ! -d debs ] # Check if debs exist
         exit 3
 fi
 
-INSTALL_LOG="/var/log/genasys_install.log"
 if [ -e $INSTALL_LOG ]
         then
         echo
@@ -97,60 +71,69 @@ echo "drone_file" > /etc/hostname
 tar zxvf drone_file_etc-hosts.tar.gz -C /
 sed -i 's/^domain.*/domain CLUSTER_DOMAINNAME/g' /etc/resolv.conf
 sed -i 's/^search.*/search CLUSTER_DOMAINNAME/g' /etc/resolv.conf
-/etc/init.d/hostname.sh
-
-echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib" > /etc/apt/sources.list.d/backports.list;PKG_SET=$?
+#/etc/init.d/hostname.sh
 
-InstallDebs () { # install included debian packages
-# add new cpan stuff thats not listed as a dependency but it is.
-PERL_MM_USE_DEFAULT=1 cpan Net::IP
-PERL_MM_USE_DEFAULT=1 cpan Business::CreditCard::Object
-# setup simpleserver manually because it broken in cpan
-if [ -e Net-Z3950-SimpleServer-1.12.tar.gz ]
+#Get_OS_Distro
+if [ "$OSDISTRO" == "Ubuntu" ]
         then
-        echo
-        echo "Setting up Net-Z3950-SimpleServer manually"
-        echo "because its broken in cpan."
-        echo
-        sleep 2
-        apt-get update && apt-get install -y make libyaz-dev
-       # add new cpan stuff thats not listed as a dependency but it is.
-       PERL_MM_USE_DEFAULT=1 cpan Net::IP
-       PERL_MM_USE_DEFAULT=1 cpan Business::CreditCard::Object
-        tar zxvf Net-Z3950-SimpleServer-1.12.tar.gz && \
-        cd Net-Z3950-SimpleServer-1.12 && \
-        perl Makefile.PL && \
-        make &&
-        make install
-        cd $WD 
+        start hostname
                 else
-                echo
-                echo "Could NOT find Net-Z3950-SimpleServer-1.12.tar.gz"
-                echo "You will need to install it manually."
-                sleep 4
+                /etc/init.d/hostname.sh
+fi
+
+### Add backports if debian 6.x
+if grep -q 'Debian GNU/Linux 6' /etc/issue
+        then
+        echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib" > /etc/apt/sources.list.d/backports.list;PKG_SET=$?
 fi
-# install debs
-./debconf-settings && \
-rm debconf-settings && \
-cd debs && \
-apt-get update && \
-gdebi --n opensrf*.deb && \
-gdebi --n libdbi_*.deb && \
-gdebi --n libdbi-drivers*.deb && \
-gdebi --n spidermonkey_*.deb && \
-gdebi --n spidermonkey-perl*.deb && \
-gdebi --n evergreen-ils*.deb
-cd ..
-chown -R opensrf:opensrf /openils
-}
 
+### Enhance bashrc for root.
+cat > bashrc-options.txt << EOF
+
+### Evergreen Modifications
+case "$TERM" in
+xterm*|rxvt*)
+    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
+    ;;
+*)
+    ;;
+esac
+
+export LS_OPTIONS='--color=auto'
+eval "`dircolors`"
+alias ls='ls $LS_OPTIONS'
+alias ll='ls $LS_OPTIONS -l'
+alias l='ls $LS_OPTIONS -lA'
+
+###
+EOF
+
+if ! grep -q "Evergreen Modifications" /root/.bashrc
+        then
+        if [ "$OSDISTRO" == "Debian" ]
+                then
+                cat bashrc-options.txt >> /root/.bashrc
+        fi
+fi
 
 if [ -e drone_file_apt.list ]
         then
+        PG_Deps_Warning () { ### Dependency install error message
+        echo
+        echo "*********"
+        echo "WARNING!! Failed to install: libpq5 libpq-dev postgresql-client-9.1"
+        echo "*********"
+        sleep 5
+        }
        echo "Installing Depdencies"
         sleep 2
        apt-get update
-       [ "$PKG_SET" = "0" ] && aptitude -t squeeze-backports -yq install libpq5 libpq-dev postgresql-client-9.0
+       if [ "$PKG_SET" = "0" ]
+               then
+               aptitude -t squeeze-backports -yq install libpq5 libpq-dev postgresql-client-9.1 || PG_Deps_Warning
+                        elif [ -z "$PKG_SET" ] ; then
+                        aptitude -yq install libpq5 libpq-dev postgresql-client-9.1 || PG_Deps_Warning
+       fi
         apt-get update && apt-get -y install $(cat drone_file_apt.list)
 fi
 
diff --git a/templates/setup-functions b/templates/setup-functions
new file mode 100644 (file)
index 0000000..5806209
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+### common functions for setup files.
+
+InstallDebs () { ### install included debian packages
+# setup simpleserver manually because it broken in cpan
+if [ "$OSDISTRO" == "Debian" ] ; then
+        if [ -e Net-Z3950-SimpleServer-1.12.tar.gz ]; then
+        echo
+        echo "Setting up Net-Z3950-SimpleServer manually"
+        echo "because its broken in cpan."
+        echo
+        sleep 2
+        apt-get update && apt-get -y install make libyaz-dev
+        # add new cpan stuff thats not listed as a dependency but it is.
+        PERL_MM_USE_DEFAULT=1 cpan Net::IP
+        PERL_MM_USE_DEFAULT=1 cpan Business::CreditCard::Object
+        tar zxvf Net-Z3950-SimpleServer-1.12.tar.gz && \
+        cd Net-Z3950-SimpleServer-1.12 && \
+        perl Makefile.PL && \
+        make &&
+        make install
+        cd $WD
+                else
+                echo
+                echo "Could NOT find Net-Z3950-SimpleServer-1.12.tar.gz"
+                echo "You will need to install it manually."
+                sleep 4
+        fi
+fi
+### install debs
+echo
+echo installing the debs now...
+#tar zxvf head_file.tar.gz -C /etc/apache2 etc/apache2/eg_vhost.conf
+./debconf-settings && \
+rm debconf-settings && \
+cd debs && \
+apt-get update && \
+gdebi --n opensrf*.deb && \
+gdebi --n spidermonkey_*.deb && \
+gdebi --n spidermonkey-perl*.deb && \
+gdebi --n libclass-dbi*.deb
+gdebi --n evergreen-ils*.deb
+cd ..
+chown -R opensrf:opensrf /openils
+}
+
+
+PG_Deps_Warning () { ### Dependency install error message
+        echo
+        echo "*********"
+        echo "WARNING!! Failed to install: libpq5 libpq-dev postgresql-client-9.1"
+        echo "*********"
+        sleep 5
+}
+
+GenSSL() { ### Generate SSL cert.
+mkdir -p /etc/apache2/ssl
+cd /etc/apache2/ssl
+openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
+cd $WD
+}
index 5989204..e6e6f3e 100755 (executable)
@@ -1,42 +1,10 @@
 #!/bin/bash
 
-#TODO: export GenaSYS version to install log.
-
-### Setup aliases for root because debian fails to do so.
-#echo "# Evergreen modifications below" >> /root/.bashrc
-#echo "alias ls='ls --color -F'" >> /root/.bashrc
-
 WD=$(dirname $(readlink -f $0))
-EG_VER="_EGVER"
-VERSION="_GENVER"
-
-### Setup colors.
-## Normal colors.
-ESC_SEQ="\x1b["
-COL_RESET=$ESC_SEQ"39;49;00m"
-COL_RED=$ESC_SEQ"0;31m"
-COL_GREEN=$ESC_SEQ"0;32m"
-COL_YELLOW=$ESC_SEQ"0;33m"
-COL_BLUE=$ESC_SEQ"0;34m"
-COL_MAGENTA=$ESC_SEQ"0;35m"
-COL_CYAN=$ESC_SEQ"0;36m"
-
-## Bright colors.
-COL_BR_RED=$ESC_SEQ"1;31m"
-COL_BR_GREEN=$ESC_SEQ"1;32m"
-COL_BR_YELLOW=$ESC_SEQ"1;33m"
-COL_BR_BLUE=$ESC_SEQ"1;34m"
-COL_BR_MAGENTA=$ESC_SEQ"1;35m"
-COL_BR_CYAN=$ESC_SEQ"1;36m"
-
-
-if [ "$(id -u)" != "0" ] # Check if we are root.
-       then 
-       echo "You must be root to setup Evergreen $EG_VER"
-       exit 1
-fi
+. "$WD/setup-vars"
+. "$WD/setup-functions"
 
-if [ ! -e head_file.tar.gz ] # Check if config files exist.
+if [ ! -e head_file.tar.gz ] ### Check if config files exist.
         then
         echo "FATAL! head_file.tar.gz is missing or "
         echo " is not in this directory"
@@ -46,7 +14,7 @@ if [ ! -e head_file.tar.gz ] # Check if config files exist.
         exit 2
 fi
 
-if [ ! -d debs ] # Check if debs exist.
+if [ ! -d debs ] ### Check if debs exist.
        then
        echo "FATAL! debs folder is missing or "
         echo " is not in this directory"
@@ -56,13 +24,6 @@ if [ ! -d debs ] # Check if debs exist.
         exit 3
 fi
 
-Prep_DB_8_4 () { #Prepare the database schema
-eg_db_config.pl --update-config \
- --service all --create-schema --create-offline \
- --user EG_DB_USER --password EG_DB_PASSWORD --hostname db01.CLUSTER_DOMAINNAME --port 5432 \
- --database evergreen --admin-user EG_ADMIN_USER --admin-pass EG_ADMIN_PASS
-
-}
 
 Prep_DB_9_X () { #Prepare the database schema
 eg_db_config.pl --service all --create-schema --create-offline \
@@ -72,7 +33,6 @@ eg_db_config.pl --service all --create-schema --create-offline \
 }
 
 
-INSTALL_LOG="/var/log/genasys_install.log"
 if [ -e $INSTALL_LOG ]
         then
         echo
@@ -130,64 +90,78 @@ echo "head_file" > /etc/hostname
 tar zxvf head_file_etc-hosts.tar.gz -C /
 sed -i 's/^domain.*/domain CLUSTER_DOMAINNAME/g' /etc/resolv.conf
 sed -i 's/^search.*/search CLUSTER_DOMAINNAME/g' /etc/resolv.conf
-/etc/init.d/hostname.sh
+#Get_OS_Distro
+if [ "$OSDISTRO" == "Ubuntu" ]
+        then
+        start hostname
+                else
+                /etc/init.d/hostname.sh
+fi
+
+### Add backports if debian 6.x
+if grep -q 'Debian GNU/Linux 6' /etc/issue
+        then
+        echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib" > /etc/apt/sources.list.d/backports.list;PKG_SET=$?
+fi
 
-echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib" > /etc/apt/sources.list.d/backports.list;PKG_SET=$?
+### Enhance bashrc for root.
+cat > bashrc-options.txt << EOF
 
+### Evergreen Modifications
+case "$TERM" in
+xterm*|rxvt*)
+    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
+    ;;
+*)
+    ;;
+esac
 
-InstallDebs () { # install included debian packages
-# setup simpleserver manually because it broken in cpan
-if [ -e Net-Z3950-SimpleServer-1.12.tar.gz ]
+export LS_OPTIONS='--color=auto'
+eval "`dircolors`"
+alias ls='ls $LS_OPTIONS'
+alias ll='ls $LS_OPTIONS -l'
+alias l='ls $LS_OPTIONS -lA'
+
+###
+EOF
+
+if ! grep -q "Evergreen Modifications" /root/.bashrc
         then
-        echo
-        echo "Setting up Net-Z3950-SimpleServer manually"
-        echo "because its broken in cpan."
-        echo
-        sleep 2
-        apt-get update && apt-get -y install make libyaz-dev
-       # add new cpan stuff thats not listed as a dependency but it is.
-       PERL_MM_USE_DEFAULT=1 cpan Net::IP
-       PERL_MM_USE_DEFAULT=1 cpan Business::CreditCard::Object
-        tar zxvf Net-Z3950-SimpleServer-1.12.tar.gz && \
-        cd Net-Z3950-SimpleServer-1.12 && \
-        perl Makefile.PL && \
-        make &&
-        make install
-        cd $WD 
-                else
-                echo
-                echo "Could NOT find Net-Z3950-SimpleServer-1.12.tar.gz"
-                echo "You will need to install it manually."
-                sleep 4
+        if [ "$OSDISTRO" == "Debian" ]
+                then
+                cat bashrc-options.txt >> /root/.bashrc
+        fi
 fi
-# install debs
-echo
-echo installing the debs now...
-#tar zxvf head_file.tar.gz -C /etc/apache2 etc/apache2/eg_vhost.conf
-./debconf-settings && \
-rm debconf-settings && \
-cd debs && \
-apt-get update && \
-gdebi --n opensrf*.deb && \
-gdebi --n libdbi_*.deb && \
-gdebi --n libdbi-drivers*.deb && \
-gdebi --n spidermonkey_*.deb && \
-gdebi --n spidermonkey-perl*.deb && \
-gdebi --n evergreen-ils*.deb
-cd ..
-chown -R opensrf:opensrf /openils
-}
 
+echo "alias detach='su - -c "brick_ctl.sh -a detach_brick" opensrf'" >> /root/.bashrc
+echo "alias attach='su - -c "brick_ctl.sh -a attach_brick" opensrf'" >> /root/.bashrc
 
+
+### Install dependencies.
 if [ -e head_file_apt.list ]
         then
-       echo "Installing Depdencies"
+       PG_Deps_Warning () { ### Dependency install error message
+       echo
+       echo "*********"
+       echo "WARNING!! Failed to install: libpq5 libpq-dev postgresql-client-9.1"
+       echo "*********"
+       sleep 5
+       }
+       echo "Installing Dependencies"
         sleep 2
        apt-get update
-       [ "$PKG_SET" = "0" ] && aptitude -t squeeze-backports -yq install libpq5 libpq-dev postgresql-client-9.1
+       if [ "$PKG_SET" = "0" ]
+               then
+               aptitude -t squeeze-backports -yq install libpq5 libpq-dev postgresql-client-9.1 || PG_Deps_Warning
+                       elif [ -z "$PKG_SET" ] ; then
+                       aptitude -yq install libpq5 libpq-dev postgresql-client-9.1 || PG_Deps_Warning
+       fi
+
+
         apt-get update && apt-get -y install  $(cat head_file_apt.list)
 fi
 
+### Install Opensrf and Evergreen debs.
 if [ -e debconf-settings ]
         then
        echo "Installing OpenSRF and Evergreen"
@@ -205,10 +179,16 @@ if [ -e debconf-settings ]
         fi
 fi
 
-tar zxvf head_file.tar.gz -C /
+### Extract config files from package
+tar zxvf head_file.tar.gz -C / >> $INSTALL_LOG 2>&1
+
+### Display extracted config files.
+cat $INSTALL_LOG
+
+### Re-affirm ownership of file to user/group opensrf.
 chown -R opensrf:opensrf /openils
 
-# Setup apache2
+### Setup apache2
 a2enmod perl
 a2enmod expires
 a2enmod include
@@ -223,15 +203,18 @@ if [ -e /etc/apache2/sites-enabled/000-default ]
 fi
 sed -i 's^NameVirtualHost^#NameVirtualHost^g' /etc/apache2/ports.conf
 
-GenSSL() { #Generate SSL cert.
-mkdir -p /etc/apache2/ssl
-cd /etc/apache2/ssl
-openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
-cd $WD
-}
+### moved to setup-functions.
+# GenSSL() { ### Generate SSL cert.
+# mkdir -p /etc/apache2/ssl
+# cd /etc/apache2/ssl
+# openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
+# cd $WD
+# }
 
+### Configure apache to run as user opensrf.
 sed -i 's/APACHE_RUN_USER=www-data/APACHE_RUN_USER=opensrf/g' /etc/apache2/envvars
 
+### Setup to log to logger01.
 if ! grep -q "Evergreen logger configuration" /etc/rsyslog.conf
        then
        echo >> /etc/rsyslog.conf
@@ -244,7 +227,7 @@ if ! grep -q "Evergreen logger configuration" /etc/rsyslog.conf
        echo "local7.*        @@logger01.CLUSTER_DOMAINNAME:514" >> /etc/rsyslog.conf
 fi
 
-# Setup database schema... We do this from the head of the first brick.
+### Setup database schema... We do this from the head of the first brick.
 if cat /etc/hostname|grep -q brick01-head
         then
        while true; do
@@ -281,6 +264,8 @@ if cat /etc/hostname|grep -q brick01-head
                                chown -R opensrf:opensrf /openils
                                Prep_DB_9_X
                                        else
+                                       echo
+                                       echo "Found db server db01.CLUSTER_DOMAINNAME"
                                        chown -R opensrf:opensrf /openils
                                        Prep_DB_9_X
                        fi
@@ -289,6 +274,7 @@ fi
 
 #
 
+### Setup NFS mounts for the brick heads
 if ! grep -q "NFS Mounts for Evergreen" /etc/fstab 
        then
        if [ -e /etc/eg_fstab_head ];then
@@ -302,6 +288,8 @@ if ! grep -q "NFS Mounts for Evergreen" /etc/fstab
                fi
                
 fi
+
+### Setup .oils_brick.cfg
 if [ -e /openils/conf/.oils_brick.cfg ] 
        then
        cp /openils/conf/.oils_brick.cfg /home/opensrf/.oils_brick.cfg
@@ -311,13 +299,15 @@ if [ -e /openils/conf/.oils_brick.cfg ]
                sleep 5
 fi     
 
-#create opensrf offline configuraton.
+### create opensrf offline configuraton.
+echo "Creating opensrf offline configuration."
 su - opensrf -c "/openils/bin/eg_db_config.pl --create-offline"
 
-#setup ldiretor ping file
+### setup ldiretor ping file
 echo "pong" > /openils/var/web/ldirectorping.txt-
 chown opensrf:opensrf /openils/var/web/ldirectorping.txt-
 
+### Setup custom lib_ips.txt file.
 if [ -e lib_ips.txt ]
        echo
        echo "Enabling lib_ips.txt.."
diff --git a/templates/setup-vars b/templates/setup-vars
new file mode 100644 (file)
index 0000000..48b1fbb
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+EG_VER="_EGVER"
+VERSION="_GENVER"
+
+### Setup colors.
+### Normal colors.
+ESC_SEQ="\x1b["
+COL_RESET=$ESC_SEQ"39;49;00m"
+COL_RED=$ESC_SEQ"0;31m"
+COL_GREEN=$ESC_SEQ"0;32m"
+COL_YELLOW=$ESC_SEQ"0;33m"
+COL_BLUE=$ESC_SEQ"0;34m"
+COL_MAGENTA=$ESC_SEQ"0;35m"
+COL_CYAN=$ESC_SEQ"0;36m"
+
+### Bright colors.
+COL_BR_RED=$ESC_SEQ"1;31m"
+COL_BR_GREEN=$ESC_SEQ"1;32m"
+COL_BR_YELLOW=$ESC_SEQ"1;33m"
+COL_BR_BLUE=$ESC_SEQ"1;34m"
+COL_BR_MAGENTA=$ESC_SEQ"1;35m"
+COL_BR_CYAN=$ESC_SEQ"1;36m"
+
+
+### Set install log
+INSTALL_LOG="/var/log/genasys_install.log"
+
+#Get_OS_Distro () {
+OSDISTRO=$(cat /etc/issue|head -1|awk '{ print $1 }')
+#}
+
+#Get_OS_Distro
+if [ "$OSDISTRO" == "Debian" ]
+        then
+        ### Setup aliases for root because debian fails to do so.
+        echo "# Evergreen modifications below" >> /root/.bashrc
+        echo "alias ls='ls --color -F'" >> /root/.bashrc
+fi
+
+if [ "$(id -u)" != "0" ] ### Check if we are root.
+        then
+        echo "You must be root to setup Evergreen $EG_VER"
+        exit 1
+fi
index 1d21522..a0a0a31 100755 (executable)
@@ -3,38 +3,8 @@
 ###TODO: export GenaSYS version to install logs.
 
 WD=$(dirname $(readlink -f $0))
-EG_VER="_EGVER"
-VERSION="_GENVER"
-
-### Setup colors.
-### Normal colors.
-ESC_SEQ="\x1b["
-COL_RESET=$ESC_SEQ"39;49;00m"
-COL_RED=$ESC_SEQ"0;31m"
-COL_GREEN=$ESC_SEQ"0;32m"
-COL_YELLOW=$ESC_SEQ"0;33m"
-COL_BLUE=$ESC_SEQ"0;34m"
-COL_MAGENTA=$ESC_SEQ"0;35m"
-COL_CYAN=$ESC_SEQ"0;36m"
-
-### Bright colors.
-COL_BR_RED=$ESC_SEQ"1;31m"
-COL_BR_GREEN=$ESC_SEQ"1;32m"
-COL_BR_YELLOW=$ESC_SEQ"1;33m"
-COL_BR_BLUE=$ESC_SEQ"1;34m"
-COL_BR_MAGENTA=$ESC_SEQ"1;35m"
-COL_BR_CYAN=$ESC_SEQ"1;36m"
-
-
-### Setup aliases for root because debian fails to do so.
-echo "# Evergreen modifications below" >> /root/.bashrc
-echo "alias ls='ls --color -F'" >> /root/.bashrc
-
-if [ "$(id -u)" != "0" ] ### Check if we are root.
-       then 
-       echo "You must be root to setup Evergreen $EG_VER"
-       exit 1
-fi
+. "$WD/setup-vars"
+. "$WD/setup-functions"
 
 if [ ! -e tar_file.tar.gz ] ### Check if config files exist.
         then
@@ -47,12 +17,13 @@ if [ ! -e tar_file.tar.gz ] ### Check if config files exist.
 fi
 
 ### Check if install log exists.
-INSTALL_LOG="/var/log/genasys_install.log"
+
 if [ -e $INSTALL_LOG ]
        then
        echo
        echo "This program has been previously"
        echo "executed on this system"  
+       sleep 1
        if [ -e .osrf_node ]
                then
                if [ ! -e debconf-settings ] ### Check if the file debconf-settings exits and warn if not
@@ -92,17 +63,30 @@ echo
 echo "Setting Hostname"
 sleep 2
 echo "tar_file" > /etc/hostname
-/etc/init.d/hostname.sh
+# Get_OS_Distro
+if [ "$OSDISTRO" == "Ubuntu" ] 
+       then
+       start hostname
+               else
+               /etc/init.d/hostname.sh 
+fi
+               
+               
+
 
 ### xtract /etc/hosts files.
-tar zxvf tar_file_etc-hosts.tar.gz -C /
+echo "Files Installed"
+tar zxvf tar_file_etc-hosts.tar.gz -C / 2>&1 | tee -a $INSTALL_LOG
 
 ### Fixup /etc/resolv.conf
 sed -i 's/^domain.*/domain CLUSTER_DOMAINNAME/g' /etc/resolv.conf
 sed -i 's/^search.*/search CLUSTER_DOMAINNAME/g' /etc/resolv.conf
 
-### Add backports.
-echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib" > /etc/apt/sources.list.d/backports.list;PKG_SET=$?
+### Add backports if debian 6.x
+if grep -q 'Debian GNU/Linux 6' /etc/issue
+       then
+       echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib" > /etc/apt/sources.list.d/backports.list;PKG_SET=$?
+fi
 
 
 if cat /etc/hostname | grep "sip\|utility" ### Check if this is a non-brick OpenSRF node.
@@ -120,55 +104,19 @@ if cat /etc/hostname | grep "sip\|utility" ### Check if this is a non-brick Open
 fi
 
 
-InstallDebs () { ### install included debian packages
-### setup simpleserver manually because it broken in cpan
-if [ -e Net-Z3950-SimpleServer-1.12.tar.gz ]
-       then
-       echo
-       echo "Setting up Net-Z3950-SimpleServer manually"
-       echo "because its broken in cpan."
-       echo
-       sleep 2
-       apt-get update && apt-get -y install make libyaz-dev
-       ### add new cpan stuff thats not listed as a dependency but it is.
-       PERL_MM_USE_DEFAULT=1 cpan Net::IP
-       PERL_MM_USE_DEFAULT=1 cpan Business::CreditCard::Object
-       tar zxvf Net-Z3950-SimpleServer-1.12.tar.gz && \
-       cd Net-Z3950-SimpleServer-1.12 && \
-       perl Makefile.PL && \
-       make &&
-       make install 
-       cd $WD
-               else
-               echo
-               echo "Could NOT find Net-Z3950-SimpleServer-1.12.tar.gz"
-               echo "You will need to install it manually."
-               sleep 4
-fi
-
-### install debs
-./debconf-settings && \
-rm debconf-settings && \
-cd debs && \
-apt-get update && \
-gdebi --n opensrf*.deb && \
-gdebi --n libdbi_*.deb && \
-gdebi --n libdbi-drivers*.deb && \
-gdebi --n spidermonkey_*.deb && \
-gdebi --n spidermonkey-perl*.deb && \
-gdebi --n evergreen-ils*.deb
-cd ..
-chown -R opensrf:opensrf /openils
-}
-
 Install_DB_Deps() { ### Install Additional Database dependencies.
-aptitude -y install gcc libxml-libxml-perl libxml-libxslt-perl && \
-PERL_MM_USE_DEFAULT=1 cpan Business::ISBN && \
-PERL_MM_USE_DEFAULT=1 cpan JSON::XS && \
-PERL_MM_USE_DEFAULT=1 cpan Library::CallNumber::LC && \
-PERL_MM_USE_DEFAULT=1 cpan MARC::Record && \
-PERL_MM_USE_DEFAULT=1 cpan UUID::Tiny && \
-PERL_MM_USE_DEFAULT=1 cpan MARC::File::XML 
+if [ "$OSDISTRO" == "Ubuntu" ]
+        then
+       aptitude -y install gcc libxml-libxml-perl libxml-libxslt-perl libjson-xs-perl libmarc-record-perl libmarc-xml-perl libuuid-tiny-perl libbusiness-isbn-perl liblibrary-callnumber-lc-perl
+else
+       aptitude -y install gcc libxml-libxml-perl libxml-libxslt-perl
+       PERL_MM_USE_DEFAULT=1 cpan Business::ISBN && \
+       PERL_MM_USE_DEFAULT=1 cpan JSON::XS && \
+        PERL_MM_USE_DEFAULT=1 cpan Library::CallNumber::LC && \
+       PERL_MM_USE_DEFAULT=1 cpan MARC::Record && \
+       PERL_MM_USE_DEFAULT=1 cpan UUID::Tiny && \
+       PERL_MM_USE_DEFAULT=1 cpan MARC::File::XML 
+fi
 }
 
 
@@ -205,9 +153,10 @@ Add_EG_DB_User() { ### Add the database user for Evergreen.
 if [ `su - postgres -c "psql -A -t -c \"select count(*) from pg_roles where rolname='evergreen'\""` = "0" ]
         then
                echo "Database user evergreen doesn't exist! Creating..."
-                chown postgres.postgres create_db_user.sql
-                su postgres -c "psql -f create_db_user.sql"
-                rm create_db_user.sql
+               echo "current directory is $(pwd)"
+                chown postgres.postgres create_db_user.sql 2>&1 | tee -a "$INSTALL_LOG";echo "chown status: $?"
+                su postgres -c "psql -f create_db_user.sql" 2>&1 | tee -a "$INSTALL_LOG";echo "pgcreatuserstatus: $?"
+                #rm create_db_user.sql
                 echo "Set db user's password"
 
 fi
@@ -215,8 +164,8 @@ fi
 
 ### Update Install log.
 echo $(date) >> "$INSTALL_LOG"
-echo "$EG_VER" >> "$INSTALL_LOG"
-echo "$VERSION" >> "$INSTALL_LOG"
+echo "Evergreen: $EG_VER" >> "$INSTALL_LOG"
+echo "GenaSYS: $VERSION" >> "$INSTALL_LOG"
 
 
 ### Install dependencies
@@ -224,9 +173,18 @@ if [ -e tar_file_apt.list ]
        then
        echo "Installing Depdencies"
        sleep 2
-       apt-get update && apt-get -y install $(cat tar_file_apt.list)
+       apt-get update 2>&1 | tee -a $INSTALL_LOG
+       apt-get -y install $(cat tar_file_apt.list) 2>&1 | tee -a "$INSTALL_LOG"
 fi
 
+PG_Deps_Warning () { ### Dependency install error message
+echo
+echo "*********"
+echo "WARNING!! Failed to install: libpq5 libpq-dev postgresql-client-9.1"
+echo "*********"
+sleep 5
+}
+
 ### Install Opensrf and Evergreen debs
 if [ -e debconf-settings ]
         then
@@ -236,7 +194,12 @@ if [ -e debconf-settings ]
        if ! dpkg -l | grep -q evergreen-ils
                then
                apt-get update
-               [ "$PKG_SET" = "0" ] && aptitude -t squeeze-backports -yq install libpq5 libpq-dev postgresql-client-9.1
+               if [ "$PKG_SET" = "0" ]
+                       then
+                        aptitude -t squeeze-backports -yq install libpq5 libpq-dev postgresql-client-9.1 || PG_Deps_Warning
+                       elif [ -z "$PKG_SET" ] ; then
+                        aptitude -yq install libpq5 libpq-dev postgresql-client-9.1 || PG_Deps_Warning
+               fi
                InstallDebs
                        else
                        echo  "Evergreen debs are already installed." 
@@ -304,6 +267,12 @@ fi
 }
 
 ### Setup DB #and repoter
+DBInstallErr () { ### DB install error.
+echo
+echo "Failed to install Postgresql packages... Cannot continue"
+exit 5
+}
+
 if cat /etc/hostname|grep -q db0 #|| cat /etc/hostname|grep -q reporter0
         then
         if [ -e /etc/sysctl.d ]
@@ -311,15 +280,12 @@ if cat /etc/hostname|grep -q db0 #|| cat /etc/hostname|grep -q reporter0
                echo
                echo "Setting up database server"
                sleep 2
-               if [ "$PKG_SET" = "0" ] 
+               if [ "$PKG_SET" = "0" ] #setup backports if debian 6.x
                        then
                        apt-get update
-                       if ! aptitude -t squeeze-backports -yq install postgresql-9.1 postgresql-contrib-9.1 postgresql-plperl-9.1 postgresql-server-dev-9.1
-                               then
-                               echo
-                               echo "Failed to setup PostgreSQL... Cannot continue"
-                               exit 5
-                       fi
+                       aptitude -t squeeze-backports -yq install postgresql-9.1 postgresql-contrib-9.1 postgresql-plperl-9.1 postgresql-server-dev-9.1 || DBInstallErr
+                       elif [ -z "$PKG_SET" ] ; then
+                        aptitude -yq install postgresql-9.1 postgresql-contrib-9.1 postgresql-plperl-9.1 postgresql-server-dev-9.1 || DBInstallErr 
                                else
                                echo
                                echo "Failed to set the backports repository for installing Postgresql"
@@ -508,7 +474,10 @@ EOF
 
 if ! grep -q "Evergreen Modifications" /root/.bashrc
        then
-       cat bashrc-options.txt >> /root/.bashrc
+       if [ "$OSDISTRO" == "Debian" ]
+               then    
+               cat bashrc-options.txt >> /root/.bashrc
+       fi
 fi