~tritone-team/tritone/eucalyptus

« back to all changes in this revision

Viewing changes to tools/euca_conf.in

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2009-12-01 21:09:28 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: james.westby@ubuntu.com-20091201210928-o2dvg0ubljhb0ft6
Tags: upstream-1.6.1~bzr1083
ImportĀ upstreamĀ versionĀ 1.6.1~bzr1083

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
WGET="`which wget 2> /dev/null`"
96
96
VERBOSE="N"
97
97
LIST=""
 
98
ENABLED=""
 
99
DISABLED=""
 
100
TO_START=""
 
101
 
98
102
 
99
103
usage () {
100
104
        echo "$0 [options] [<file>]"
106
110
        echo "   --no-scp                         don't use scp"
107
111
        echo "   --get-credentials <zipfile>      download credentials to <zipfile>"
108
112
        echo "   --register-nodes \"host host ...\" add new nodes to EUCALYPTUS"
109
 
        echo "   --delete-nodes \"host host ...\"   remove nodes from EUCALYPTUS"
 
113
        echo "   --deregister-nodes \"host host ...\"   remove nodes from EUCALYPTUS"
110
114
        echo "   --register-cluster <name> <host> add new cluster to EUCALYPTUS"
111
115
        echo "   --deregister-cluster <name>      remove cluster from EUCALYPTUS"
112
116
        echo "   --register-walrus <host>         add walrus to EUCALYPTUS"
120
124
        echo "   --cc-port <port>                 set CC port"
121
125
        echo "   --nc-port <port>                 set NC port"
122
126
        echo "   --instances <path>               set the INSTANCE path"
123
 
        echo "   --cloud-port <port1> <port2>     set the 2 cloud ports"
 
127
#       echo "   --cloud-port <port1> <port2>     set the 2 cloud ports"
124
128
        echo "   --hypervisor <kvm|xen>           set hypervisor to use"
125
129
        echo "   --user <euca_user>               set the user to use"
126
130
        echo "   --dhcpd <dhcpd>                  set the dhcpd binary to <name>"
128
132
        echo "   --name <var>                     returns the value or <name>"
129
133
        echo "   --import-conf <file>             import variables from <file> into eucalyptus.conf"
130
134
        echo "   --setup                          perform initial setup"
131
 
        echo "   --check [nc|cc|cloud|sc|walrus]  pre-flight checks"
132
 
        echo "   --sync [nc|cc|cloud|sc|walrus]   pre-flight checks"
 
135
        echo "   --enable {cloud|walrus|sc}       enable service at next start"
 
136
        echo "   --disable {cloud|walrus|sc}      disable service at next start"
 
137
        echo "   --check {nc|cc|cloud|sc|walrus}  pre-flight checks"
 
138
#       echo "   --sync {nc|cc|cloud|sc|walrus}   pre-flight checks"
133
139
        echo "   --version                        eucalyptus version"
134
140
        echo
135
141
}
561
567
                continue
562
568
        fi
563
569
        if [ "$1" = "--register-sc" ]; then
 
570
                if [ $# -lt 3 ]; then
 
571
                        echo "--register-sc requires a CC and a hostname"
 
572
                        exit 1
 
573
                fi
564
574
                SC_MODE="ADD"
565
575
                SCNAME="$2"
566
576
                SCHOST="$3"
593
603
                shift; shift
594
604
                continue
595
605
        fi
 
606
        if [ "$1" = "--enable" ]; then 
 
607
                if [ "$2" != "cloud" -a "$2" != "sc" -a "$2" != "walrus" ]; then
 
608
                        echo "--enable requires cloud, sc or walrus"
 
609
                        exit 1
 
610
                fi
 
611
                ENABLED="$ENABLED $2"
 
612
                shift; shift
 
613
                continue
 
614
        fi
 
615
        if [ "$1" = "--disable" ]; then 
 
616
                if [ "$2" != "cloud" -a "$2" != "sc" -a "$2" != "walrus" ]; then
 
617
                        echo "--disable requires cloud, sc or walrus"
 
618
                        exit 1
 
619
                fi
 
620
                DISABLED="$DISABLED $2"
 
621
                shift; shift
 
622
                continue
 
623
        fi
596
624
        if [ "$1" = "-sync" -o "$1" = "--sync" ]; then 
597
625
                if [ "$2" != "cc" -a "$2" != "cloud" -a "$2" != "nc" -a "$2" != "sc" -a "$2" != "walrus" ]; then
598
626
                        echo "-sync requires cc, nc, sc, walrus or cloud"
683
711
 
684
712
# modify the current conf file based on an older configuration, or from import file
685
713
if [ -n "$UPGRADE_CONF" -o -n "$IMPORTFILE" ]; then
686
 
        VARS="EUCA_USER ENABLE_WS_SECURITY DISABLE_EBS HYPERVISOR LOGLEVEL CLOUD_PORT CLOUD_SSL_PORT SWAP_SIZE CC_PORT SCHEDPOLICY NODES NC_SERVICE NC_PORT MAX_MEM MAX_CORES INSTANCE_PATH VNET_INTERFACE VNET_BRIDGE VNET_DHCPDAEMON"
687
 
        VNET_VARS="VNET_MODE VNET_SUBNET VNET_NETMASK VNET_DNS VNET_ADDRSPERNET VNET_PUBLICIPS VNET_BROADCAST VNET_ROUTER VNET_MACMAP"
 
714
        VARS="EUCA_USER ENABLE_WS_SECURITY DISABLE_EBS HYPERVISOR LOGLEVEL SWAP_SIZE CC_PORT MANUAL_INSTANCES_CLEANUP NC_CACHE_SIZE SCHEDPOLICY NODES NC_SERVICE NC_PORT MAX_MEM MAX_CORES INSTANCE_PATH VNET_BRIDGE VNET_DHCPDAEMON VNET_DHCPUSER"
 
715
        VNET_VARS="VNET_MODE VNET_SUBNET VNET_NETMASK VNET_DNS VNET_ADDRSPERNET VNET_PUBLICIPS VNET_BROADCAST VNET_ROUTER VNET_MACMAP VNET_INTERFACE"
688
716
        
689
717
        if [ -n "$UPGRADE_CONF" ]; then
690
718
        # source the old config
731
759
            y="$(echo \$${x})"
732
760
            eval y="$y"
733
761
            if [ -n "$y" ]; then
734
 
                echo "$x=\"${y}\"" >> $FILE
 
762
                if [ "$x" = "VNET_INTERFACE" ]; then
 
763
                        change_var_value $FILE VNET_PRIVINTERFACE "${y}"
 
764
                        change_var_value $FILE VNET_PUBINTERFACE "${y}"
 
765
                else
 
766
                        echo "$x=\"${y}\"" >> $FILE
 
767
                fi
735
768
            fi
736
769
        done
737
770
fi
802
835
        let $((ret += $?))
803
836
        chown -R $EUCA_USER:$EUCA_GROUP $EUCALYPTUS/var/run/eucalyptus
804
837
        let $((ret += $?))
 
838
        chown $EUCA_USER:$EUCA_GROUP $EUCALYPTUS/etc/eucalyptus/eucalyptus.conf
 
839
        let $((ret += $?))
805
840
 
806
841
        # let's create more needed directory with the right permissions
807
842
        mkdir -p $EUCALYPTUS/var/lib/eucalyptus/db
1418
1453
                done
1419
1454
        fi
1420
1455
done
 
1456
 
 
1457
# enable/disable services
 
1458
if [ -r $EUCALYPTUS/var/lib/eucalyptus/services ]; then
 
1459
        for x in `cat $EUCALYPTUS/var/lib/eucalyptus/services` ; do
 
1460
                TO_START="$TO_START $x"
 
1461
        done
 
1462
fi
 
1463
if [ -n "$DISABLED" -o -n "$ENABLED" ]; then
 
1464
        for x in $TO_START $ENABLED ; do
 
1465
                to_start="Y"
 
1466
                for y in $DISABLED ; do
 
1467
                        if [ "$x" = "$y" ]; then
 
1468
                                to_start="N"
 
1469
                        fi
 
1470
                done
 
1471
                [ $to_start = "Y" ] && echo $x
 
1472
        done | sort | uniq > $EUCALYPTUS/var/lib/eucalyptus/services
 
1473
fi