~tritone-team/tritone/eucalyptus

« back to all changes in this revision

Viewing changes to tools/eucalyptus-nc.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:
111
111
fi
112
112
export EUCALYPTUS
113
113
 
114
 
# just a quick way to check if we have the package still installed: at
115
 
# times we can still have the init.d script
116
 
if [ ! -x $EUCALYPTUS/usr/sbin/euca_conf ]; then
117
 
        echo "Some eucalyptus components are missing"
118
 
        exit 1
119
 
fi
120
 
 
121
114
create_httpd_config() {
122
115
        IPS="all"
123
116
        
135
128
 
136
129
# crude way to start the axis2c services
137
130
do_start() {
 
131
        # fixes #469984
 
132
        IPTABLES="`which iptables 2> /dev/null`"
 
133
        if [ -n "$IPTABLES" ]; then
 
134
                [ -x $IPTABLES ] && $IPTABLES -L -n > /dev/null 2> /dev/null
 
135
        fi
 
136
 
138
137
        if [ ! -x $HTTPD ]; then
 
138
                echo
139
139
                echo "cannot find httpd (was set to <$HTTPD>)!"
140
140
                exit 1
141
141
        fi
 
142
        if [ ! -x $EUCALYPTUS/usr/sbin/euca_conf ]; then
 
143
                echo "Some eucalyptus components are missing"
 
144
                exit 1
 
145
        fi
142
146
 
143
147
        if ! $EUCALYPTUS/usr/sbin/euca_conf --check nc ; then
144
148
                exit 1
146
150
 
147
151
        # we have a program to test the hypervisor and more for the NC
148
152
        if [ ! -x $EUCALYPTUS/usr/sbin/euca_test_nc ]; then
 
153
                echo
149
154
                echo "Cannot check Node Controller: missing euca_test_nc."
150
155
        elif ! $EUCALYPTUS/usr/sbin/euca_test_nc $HYPERVISOR > $EUCALYPTUS/var/log/eucalyptus/euca_test_nc.log 2>&1 ; then
 
156
                echo
151
157
                echo "Node Controller cannot be started: errors in $EUCALYPTUS/var/log/eucalyptus/euca_test_nc.log"
152
158
                exit 1
153
159
        fi
164
170
 
165
171
        # we need aoe loaded 
166
172
        if [ -z "$MODPROBE" ]; then
 
173
                echo
167
174
                echo "Cannot find modprobe: you may have problems."
168
175
        elif ! $MODPROBE aoe ; then
 
176
                echo
169
177
                echo "Failed to load aoe: you may experience problems"
170
178
        fi
171
179
 
173
181
        if [ -w /proc/sys/net/ipv4/ip_forward ]; then
174
182
                VAL=`cat /proc/sys/net/ipv4/ip_forward`
175
183
                if [ "$VAL" = "0" ]; then
 
184
                        echo
176
185
                        echo "Enabling IP forwarding for eucalyptus."
177
186
                        echo -n 1 > /proc/sys/net/ipv4/ip_forward
178
187
                fi
180
189
        if [ -w /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
181
190
                VAL=`cat /proc/sys/net/bridge/bridge-nf-call-iptables`
182
191
                if [ "$VAL" = "0" ]; then
 
192
                        echo
183
193
                        echo "Enabling bridge netfiltering for eucalyptus."
184
194
                        echo 1 >  /proc/sys/net/bridge/bridge-nf-call-iptables
185
195
                fi
189
199
        create_httpd_config
190
200
 
191
201
        if ! $HTTPD -f $EUCALYPTUS/etc/eucalyptus/httpd-nc.conf ; then
 
202
                echo
192
203
                echo "Failed to start the NC!"
193
204
                exit 1
194
205
        fi
198
209
        pidfile=$EUCALYPTUS/var/run/eucalyptus/eucalyptus-nc.pid
199
210
        if [ -s $pidfile ]; then
200
211
                pid=`cat $pidfile 2> /dev/null`
201
 
                if ps ax|grep $pid|grep httpd-nc.conf > /dev/null ; then
 
212
                if ps axww|grep $pid|grep httpd-nc.conf > /dev/null ; then
202
213
                        # we are good
203
214
                        return 0
204
215
                fi
275
286
for y in $EUCALYPTUS/opt $EUCALYPTUS/packages $EUCALYPTUS /opt ; do
276
287
        for x in `/bin/ls $y 2> /dev/null`; do
277
288
                # this is for the RPM installed pacakges
278
 
                if [ "$x" = "euca-libvirt" ]; then
279
 
                        export LIBVIRT_HOME="$y/$x"
280
 
                fi
281
289
                if [ "$x" = "euca-axis2c" ]; then
282
 
                        export AXIS2C_HOME="$y/$x"
 
290
                        if [ -e $y/$x/lib/libmod_axis2.so ]; then
 
291
                                export AXIS2C_HOME="$y/$x"
 
292
                        fi
283
293
                fi
284
294
                # this is for system or source installed
285
295
                if [ "`echo $x | cut -f 1 -d -`" = "axis2c" ]; then
287
297
                                export AXIS2C_HOME="$y/$x"
288
298
                        fi
289
299
                fi
290
 
                if [ "`echo $x | cut -f 1 -d -`" = "libvirt" ]; then
291
 
                        export LIBVIRT_HOME="$y/$x"
292
 
                fi
293
300
        done
294
301
done
295
302
 
311
318
        exit 1
312
319
fi
313
320
 
314
 
# if we have a custom libvirt let's use it
315
 
if [ -n "$LIBVIRT_HOME" ]; then
316
 
        export LD_LIBRARY_PATH="$LIBVIRT_HOME/lib:$LIBVIRT_HOME/usr/lib:$LD_LIBRARY_PATH"
317
 
        export PATH="$LIBVIRT_HOME/bin:$PATH"
318
 
fi
319
 
 
320
321
# set the library path correctly
321
322
export LD_LIBRARY_PATH="$AXIS2C_HOME/lib:$AXIS2C_HOME/modules/rampart:$EUCALYPTUS/usr/lib/eucalyptus:$LD_LIBRARY_PATH"
322
323