Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 426 lines (385 sloc) 12.204 kB
23d314c Added new script to start/stop walrus and sc
graziano authored
1 #!/bin/bash
48052e3 added license header to source files (not clc/)
root authored
2 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
3 # Copyright 2009-2012 Eucalyptus Systems, Inc.
0192439 @gholms Clean up trailing spaces
gholms authored
4 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 3 of the License.
48052e3 added license header to source files (not clc/)
root authored
8 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
0192439 @gholms Clean up trailing spaces
gholms authored
13 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see http://www.gnu.org/licenses/.
48052e3 added license header to source files (not clc/)
root authored
16 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
17 # Please contact Eucalyptus Systems, Inc., 6755 Hollister Ave., Goleta
18 # CA 93117, USA or visit http://www.eucalyptus.com/licenses/ if you need
19 # additional information or have any questions.
48052e3 added license header to source files (not clc/)
root authored
20 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
21 # This file may incorporate work covered under the following copyright
22 # and permission notice:
48052e3 added license header to source files (not clc/)
root authored
23 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
24 # Software License Agreement (BSD License)
0192439 @gholms Clean up trailing spaces
gholms authored
25 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
26 # Copyright (c) 2008, Regents of the University of California
27 # All rights reserved.
48052e3 added license header to source files (not clc/)
root authored
28 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
29 # Redistribution and use of this software in source and binary forms,
30 # with or without modification, are permitted provided that the
31 # following conditions are met:
48052e3 added license header to source files (not clc/)
root authored
32 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
33 # Redistributions of source code must retain the above copyright
34 # notice, this list of conditions and the following disclaimer.
48052e3 added license header to source files (not clc/)
root authored
35 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
36 # Redistributions in binary form must reproduce the above copyright
37 # notice, this list of conditions and the following disclaimer
38 # in the documentation and/or other materials provided with the
39 # distribution.
48052e3 added license header to source files (not clc/)
root authored
40 #
054a11a @gholms Update GPL+BSD file headers
gholms authored
41 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
42 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
43 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
44 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
45 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
46 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
47 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
49 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
51 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
52 # POSSIBILITY OF SUCH DAMAGE. USERS OF THIS SOFTWARE ACKNOWLEDGE
53 # THE POSSIBLE PRESENCE OF OTHER OPEN SOURCE LICENSED MATERIAL,
54 # COPYRIGHTED MATERIAL OR PATENTED MATERIAL IN THIS SOFTWARE,
55 # AND IF ANY SUCH MATERIAL IS DISCOVERED THE PARTY DISCOVERING
56 # IT MAY INFORM DR. RICH WOLSKI AT THE UNIVERSITY OF CALIFORNIA,
57 # SANTA BARBARA WHO WILL THEN ASCERTAIN THE MOST APPROPRIATE REMEDY,
58 # WHICH IN THE REGENTS' DISCRETION MAY INCLUDE, WITHOUT LIMITATION,
59 # REPLACEMENT OF THE CODE SO IDENTIFIED, LICENSING OF THE CODE SO
60 # IDENTIFIED, OR WITHDRAWAL OF THE CODE CAPABILITY TO THE EXTENT
61 # NEEDED TO COMPLY WITH ANY SUCH LICENSES OR RIGHTS.
23d314c Added new script to start/stop walrus and sc
graziano authored
62 #
63 # chkconfig: 2345 99 05
054a11a @gholms Update GPL+BSD file headers
gholms authored
64 # description: eucalyptus java ws services
23d314c Added new script to start/stop walrus and sc
graziano authored
65 #
66 ### BEGIN INIT INFO
2d839b7 use euca_conf to enable/disable ws starts/stop and use only one init
graziano authored
67 # Provides: eucalyptus
0192439 @gholms Clean up trailing spaces
gholms authored
68 # Required-Start: $remote_fs $syslog
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
69 # Should-Start: START
0192439 @gholms Clean up trailing spaces
gholms authored
70 # Required-Stop: $remote_fs $syslog
23d314c Added new script to start/stop walrus and sc
graziano authored
71 # Default-Start: 2 3 4 5
72 # Default-Stop: 0 1 6
054a11a @gholms Update GPL+BSD file headers
gholms authored
73 # Short-Description: Eucalyptus java web services
74 # Description: Eucalyptus java web services
23d314c Added new script to start/stop walrus and sc
graziano authored
75 # X-UnitedLinux-Default-Enabled: yes
76 ### END INIT INFO
77 #
78
79 # Do NOT "set -e"
80
81 # we need to source the current path in case of manual intallation
82 export PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
2d839b7 use euca_conf to enable/disable ws starts/stop and use only one init
graziano authored
83 DESC="Eucalyptus services"
efc277f Ready for more testing.
graziano authored
84 NAME=""
23d314c Added new script to start/stop walrus and sc
graziano authored
85 ANT="`which ant 2> /dev/null`"
86 EUCA_USER="eucalyptus"
87
88 if [ "$EUID" != "0" ]; then
6204113 Be sure we are checking for the right sercice.
graziano authored
89 echo "Eucalyptus init scripts must be run as root."
90 exit 1
23d314c Added new script to start/stop walrus and sc
graziano authored
91 fi
92
7a4874c @mspaulding06 Fix localization settings not getting properly sourced
mspaulding06 authored
93 # Use the functions script for distributions that support it (e.g., RHEL)
94 # This allows Eucalyptus to use correct localization settings
95 [ -f /etc/init.d/functions ] && . /etc/init.d/functions
96
23d314c Added new script to start/stop walrus and sc
graziano authored
97 # if we have lsb functions let's source them
98 WE_HAVE_LSB="N"
99 if [ -e /lib/lsb/init-functions ]; then
100 . /lib/lsb/init-functions
101 # very old lsb don't have the functions we need
102 if type log_daemon_msg > /dev/null 2> /dev/null ; then
103 WE_HAVE_LSB="Y"
104 fi
105 fi
106
107 # honor the ENV variable if found otherwise look in root
108 if [ -z "$EUCALYPTUS" ] ; then
109 EUCALYPTUS="@prefix@"
0192439 @gholms Clean up trailing spaces
gholms authored
110 if [ ! -e ${EUCALYPTUS}/etc/eucalyptus/eucalyptus.conf ] ; then
23d314c Added new script to start/stop walrus and sc
graziano authored
111 EUCALYPTUS="/"
112 fi
113 fi
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
114
115 # Read configuration variable file if it is present
116 if [ -r $EUCALYPTUS/etc/eucalyptus/eucalyptus.conf ]; then
780390c avoid useless warning
graziano authored
117 EUCA_TMP="`readlink -f ${EUCALYPTUS}`"
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
118 . $EUCALYPTUS/etc/eucalyptus/eucalyptus.conf
119
120 # has eucalyptus been configured?
121 if [ "$EUCALYPTUS" = "not_configured" ]; then
0192439 @gholms Clean up trailing spaces
gholms authored
122 echo "EUCALYPTUS not configured!"
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
123 exit 1
124 fi
125
126 # there may be inconsistencied between conf file and env variable
780390c avoid useless warning
graziano authored
127 if [ "$EUCA_TMP" != "`readlink -f ${EUCALYPTUS}`" ]; then
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
128 echo "Warning: you should check EUCALYPTUS in conf file"
129 fi
130 else
2a1034d Made the init.d scripts less strict in checking dependencies if we are
graziano authored
131 # on removal of RPM we can get in a state in which the conf file
132 # is gone but the services are still running: make this hard
133 # failure only if we are not stopping
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
134 echo "Cannot find eucalyptus configuration file!"
2a1034d Made the init.d scripts less strict in checking dependencies if we are
graziano authored
135 if [ "$1" != "stop" ]; then
136 exit 1
137 fi
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
138 fi
fd43b0d @sjones4 EUCA-2034 Environment initialization scripts can now be run prior to …
sjones4 authored
139 # Run additional initialization scripts if present
140 if [ -d $EUCALYPTUS/etc/eucalyptus/cloud.d/init.d ]; then
141 for EUCA_INIT_FILE in $EUCALYPTUS/etc/eucalyptus/cloud.d/init.d/*; do
142 if [ -r "${EUCA_INIT_FILE}" ]; then
143 # init.d scripts are evaluated but are not permitted to modify
144 # environment
145 bash "${EUCA_INIT_FILE}" "${@}"
a73a59e @sjones4 EUCA-2034 PostgreSQL sysctl settings are now checked when setting ker…
sjones4 authored
146 if [ $? -ne 0 ] ; then
147 echo "Initialization script failed: " $(basename "${EUCA_INIT_FILE}")
148 exit 1
149 fi
fd43b0d @sjones4 EUCA-2034 Environment initialization scripts can now be run prior to …
sjones4 authored
150 fi
151 done
152 fi
23d314c Added new script to start/stop walrus and sc
graziano authored
153 export EUCALYPTUS
af7f9a9 enabled 'fakeregisteration' mode in euca_conf, added 'eucalyptus-clou…
root authored
154
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
155 pidfile=$EUCALYPTUS/var/run/eucalyptus/eucalyptus-cloud.pid
085be77 Fix java home determination, and direct startup output to a log inste…
Andy Grimm authored
156 initlog=$EUCALYPTUS/var/log/eucalyptus/startup.log
23d314c Added new script to start/stop walrus and sc
graziano authored
157
7c10b46 add java version check to upgrade (#3665)
Andy Grimm authored
158 check_java_version() {
159 # First check CLOUD_OPTS for --java-home
2ba15db try harder to find java executable if a user or packager sets java ho…
Andy Grimm authored
160 JAVA=""
7c10b46 add java version check to upgrade (#3665)
Andy Grimm authored
161 JH=$( echo $CLOUD_OPTS | \
162 sed -r -e '/--java-home/!d; s/^.*(--java-home(=|\s+)(\S+)).*$/\3/g' );
163 if [ -n "$JH" ]; then
2ba15db try harder to find java executable if a user or packager sets java ho…
Andy Grimm authored
164 if [ -x $JH/jre/bin/java ]; then
165 JAVA=$JH/jre/bin/java
166 elif [ -x $JH/bin/java ]; then
167 JAVA=$JH/bin/java
168 fi
7c10b46 add java version check to upgrade (#3665)
Andy Grimm authored
169 elif [ -n "$JAVA_HOME" ]; then
2ba15db try harder to find java executable if a user or packager sets java ho…
Andy Grimm authored
170 if [ -x $JAVA_HOME/jre/bin/java ]; then
171 JAVA=$JAVA_HOME/jre/bin/java
172 elif [ -x $JAVA_HOME/bin/java ]; then
173 JAVA=$JAVA_HOME/bin/java
174 fi
175 fi
176 if [ -z "$JAVA" ]; then
7c10b46 add java version check to upgrade (#3665)
Andy Grimm authored
177 JAVA=$( which java )
178 fi
179 JV=$( $JAVA -version 2>&1 | \
180 sed -r -e '/^java version/!d; s/^java version "(.*)"/\1/' )
181 VER=$( echo $JV | cut -d_ -f1 )
182 PATCH=$( echo $JV | cut -d_ -f2 )
183 if [ "$VER" != "1.6.0" ]; then
184 echo "ERROR: Only JVM 1.6.0 is supported" >&2
185 exit 1
186 elif [ -z "$PATCH" ] || [ $PATCH -lt 20 ]; then
187 echo "ERROR: JVM 1.6.0 patch 20 or newer is required" >&2
188 exit 1
189 fi
190 }
191
be67b21 run db upgrade if eucalyptus.upgrade exists, remove after.
Neil authored
192 do_upgrade() {
193 while IFS=: read -r a b; do
194 OLD_EUCA_VERSION=$a
195 OLD_EUCA_PATH=$b
a248016 @gholms Run euca_upgrade as $EUCA_USER; minor upgrade fixes
gholms authored
196 done < $EUCALYPTUS/etc/eucalyptus/.upgrade
197
198 if [ "$OLD_EUCA_VERSION" = "@EUCA_VERSION@" ]; then
199 # No need to upgrade to the same version
200 return
201 fi
202
e79a224 remove old webapp when init script performs upgrade
Andy Grimm authored
203 # Remove old unpacked webapp area
204 rm -rf $EUCALYPTUS/var/run/eucalyptus/webapp
205
7c10b46 add java version check to upgrade (#3665)
Andy Grimm authored
206 # Java version check: older than 1.6.0_22 is bad
207 check_java_version
208
a248016 @gholms Run euca_upgrade as $EUCA_USER; minor upgrade fixes
gholms authored
209 # Attempt db upgrade
89cffcd added log msg.
Neil authored
210 echo "Attempting database upgrade from $OLD_EUCA_VERSION at $OLD_EUCA_PATH..."
3463410 Make upgrades name partitions and clusters the same for now. Fix ISCS…
Andy Grimm authored
211 $EUCALYPTUS/usr/share/eucalyptus/euca_upgrade --old $OLD_EUCA_PATH --new $EUCALYPTUS --db --user $EUCA_USER
be67b21 run db upgrade if eucalyptus.upgrade exists, remove after.
Neil authored
212 case "$?" in
a248016 @gholms Run euca_upgrade as $EUCA_USER; minor upgrade fixes
gholms authored
213 0)
214 echo "done."
215 rm -f $EUCALYPTUS/etc/eucalyptus/.upgrade
01f0c77 fix borked eucalyptus-cloud.
Neil authored
216 ;;
a248016 @gholms Run euca_upgrade as $EUCA_USER; minor upgrade fixes
gholms authored
217 1)
be67b21 run db upgrade if eucalyptus.upgrade exists, remove after.
Neil authored
218 echo "Upgrade failed. Aborting start."
219 exit 1
01f0c77 fix borked eucalyptus-cloud.
Neil authored
220 ;;
be67b21 run db upgrade if eucalyptus.upgrade exists, remove after.
Neil authored
221 esac
222 }
223
23d314c Added new script to start/stop walrus and sc
graziano authored
224 do_start() {
622100d don't reset CLOUD_OPTS.
Neil authored
225 if [ -z "$CLOUD_OPTS" ]; then
414bd60 promote http client logging to 'ERROR' for vmware, make default log-l…
root authored
226 local CLOUD_OPTS="--log-level=INFO"
622100d don't reset CLOUD_OPTS.
Neil authored
227 fi
23d314c Added new script to start/stop walrus and sc
graziano authored
228
229 # basic checks
2a1034d Made the init.d scripts less strict in checking dependencies if we are
graziano authored
230 if [ ! -x $EUCALYPTUS/usr/sbin/euca_conf ]; then
231 echo "Some eucalyptus components are missing"
232 exit 1
233 fi
234
23d314c Added new script to start/stop walrus and sc
graziano authored
235 cd $EUCALYPTUS/etc/eucalyptus
058db02 added 'deregister' to euca_conf, eucalyptus-dns handling from eucalyp…
root authored
236
dde34ad @gholms Drop ATA over Ethernet support
gholms authored
237 # Check if we need to upgrade
a248016 @gholms Run euca_upgrade as $EUCA_USER; minor upgrade fixes
gholms authored
238 if [ -e $EUCALYPTUS/etc/eucalyptus/.upgrade ]; then
be67b21 run db upgrade if eucalyptus.upgrade exists, remove after.
Neil authored
239 do_upgrade
240 fi
241
4024bf7 @gholms Create loop devices upon NC, cloud startup
gholms authored
242 # Add loop devices if necessary (and possible)
243 [ -z "$CREATE_SC_LOOP_DEVICES" ] && CREATE_SC_LOOP_DEVICES=256
244 if [ "$CREATE_SC_LOOP_DEVICES" -gt 0 ] 2>/dev/null; then
245 "$EUCALYPTUS/usr/share/eucalyptus/create-loop-devices" $CREATE_SC_LOOP_DEVICES
246 fi
247
89eee06 raise max number of open files in cloud init script
root authored
248 ulimit -n 4096
085be77 Fix java home determination, and direct startup output to a log inste…
Andy Grimm authored
249 $EUCALYPTUS/usr/sbin/eucalyptus-cloud $CLOUD_OPTS -h $EUCALYPTUS -u $EUCA_USER --pidfile ${pidfile} -f \
250 -L console-log -o $initlog -e $initlog
00941d7 better handling of --register-* in euca_conf
graziano authored
251 return $?
e59ae0b cloud has more than one jar file: fixed init script to handle that.
graziano authored
252 }
253
23d314c Added new script to start/stop walrus and sc
graziano authored
254 do_status() {
e960d44 attempt to resolve eucalyptus-cloud pidfile restart race
root authored
255 local inpid="$1"
256 local ret=0
257
258 if [ -z "$inpid" ]; then
259 if [ -s ${pidfile} ]; then
260 pid=`cat ${pidfile} 2> /dev/null`
261 else
262 # no input pid, no pidfile, can't do anything
263 return 1
264 fi
265 else
266 pid="$inpid"
267 fi
268
269 ppid=`ps -p $pid -o ppid=`
270 if [ -n "$ppid" ]; then
271 if ! ps axww|grep $ppid|grep eucalyptus-cloud.pid >/dev/null; then
272 # pid file is not matching parent pid
273 ret=1
274 fi
275 fi
276 if [ -n "$pid" ]; then
277 if ! ps axww|grep $pid|grep eucalyptus-cloud.pid > /dev/null; then
278 # pid file is not matching
279 ret=1
280 fi
281 fi
9e6fb10 init script fixes
root authored
282
e960d44 attempt to resolve eucalyptus-cloud pidfile restart race
root authored
283 return $ret
23d314c Added new script to start/stop walrus and sc
graziano authored
284 }
285
286 do_stop() {
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
287 # now stop the service
288 if [ -s "${pidfile}" ]; then
23d314c Added new script to start/stop walrus and sc
graziano authored
289 pid=`cat $pidfile 2> /dev/null`
51ef2ca another fix to attempt full eucalyptus-cloud shutdown on 'stop'
root authored
290 ppid=`ps -p $pid -o ppid=`
9e6fb10 init script fixes
root authored
291 kill $pid > /dev/null 2>&1
23d314c Added new script to start/stop walrus and sc
graziano authored
292 else
293 return
294 fi
295
89ec510 restore shorter timer in init script
grze@eucalyptus.com authored
296 timeout=40
23d314c Added new script to start/stop walrus and sc
graziano authored
297 while [ $timeout -gt 0 ]; do
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
298 if do_status ; then
23d314c Added new script to start/stop walrus and sc
graziano authored
299 sleep 1
300 timeout=$(($timeout - 1))
301 else
302 break
303 fi
304 done
305 if [ $timeout -eq 0 ]; then
c7c6cec remove warning until more completely tested in QA environment
Daniel Nurmi authored
306 # echo "WARNING: timed out waiting for eucalyptus-cloud process to shut down (pid=$pid, ppid=$ppid)."
1c310c0 update to eucalyptus-cloud init script to remove -9s
Daniel Nurmi authored
307 # explicit kill -9 is dangerous with DB process running,
308 # could lead to loss of data and so we'll print the
309 # above error.
a8a60e3 ignore service transistions if CC is shutdown
Daniel Nurmi authored
310 kill -9 $pid > /dev/null 2>&1
311 kill -9 $ppid > /dev/null 2>&1
23d314c Added new script to start/stop walrus and sc
graziano authored
312 fi
313 rm -f $pidfile
9e6fb10 init script fixes
root authored
314
23d314c Added new script to start/stop walrus and sc
graziano authored
315 }
316
317 # let's get the user to use
318 if [ -z "$EUCA_USER" ] ; then
319 EUCA_USER="root"
320 fi
321
322 # set the library path correctly
085be77 Fix java home determination, and direct startup output to a log inste…
Andy Grimm authored
323 if [ -z "$VDDK_HOME" ] ; then
324 VDDK_HOME="@VDDK_HOME@"
325 fi
326 export VDDK_HOME
ef10522 small fix-ups to init script and imager wrapper
root authored
327
328 # moved these to the euca_imager wrapper itself
329 #export LD_LIBRARY_PATH="$EUCALYPTUS/usr/lib/eucalyptus:$VDDK_HOME/lib:$VDDK_HOME/lib/vmware-vix-disklib/lib32:$VDDK_HOME/lib/vmware-vix-disklib/lib64/" # to ensure euca_imager finds VDDK libs
330 #export PATH="$EUCALYPTUS/usr/lib/eucalyptus:$PATH" # to ensure euca_imager has euca_rootwrap
a7887e9 extra checks and env vars in eucalyptus-cloud init script
root authored
331
9e6fb10 init script fixes
root authored
332 #VERBOSE="yes"
333
23d314c Added new script to start/stop walrus and sc
graziano authored
334 case "$1" in
335 start)
336 if [ "$VERBOSE" != no ]; then
337 if [ "$WE_HAVE_LSB" = "Y" ]; then
2d839b7 use euca_conf to enable/disable ws starts/stop and use only one init
graziano authored
338 log_daemon_msg "Starting $DESC" "$NAME"
23d314c Added new script to start/stop walrus and sc
graziano authored
339 else
80f0b10 Uninstalling RPMs wouldn't stop the services anylonger: fixed.
graziano authored
340 echo -n "Starting $DESC: $NAME"
23d314c Added new script to start/stop walrus and sc
graziano authored
341 fi
342 fi
343
344 # let's check there is no previous cloud running
345 if do_status ; then
346 echo
0a9d2a4 fixed typo in init script.
Neil authored
347 echo "$DESC are already running!"
23d314c Added new script to start/stop walrus and sc
graziano authored
348 if [ "$VERBOSE" != no ]; then
349 if [ "$WE_HAVE_LSB" = "Y" ]; then
350 log_end_msg 1
351 fi
352 fi
9e6fb10 init script fixes
root authored
353 exit 0
23d314c Added new script to start/stop walrus and sc
graziano authored
354 fi
355
356 do_start
00941d7 better handling of --register-* in euca_conf
graziano authored
357
23d314c Added new script to start/stop walrus and sc
graziano authored
358 case "$?" in
085be77 Fix java home determination, and direct startup output to a log inste…
Andy Grimm authored
359 0)
23d314c Added new script to start/stop walrus and sc
graziano authored
360 if [ "$VERBOSE" != no ]; then
361 if [ "$WE_HAVE_LSB" = "Y" ]; then
362 log_end_msg 0
363 else
364 echo "done."
365 fi
366 fi
367 ;;
368 *)
369 if [ "$VERBOSE" != no ]; then
370 if [ "$WE_HAVE_LSB" = "Y" ]; then
371 log_end_msg 1
372 else
085be77 Fix java home determination, and direct startup output to a log inste…
Andy Grimm authored
373 echo "failed! Check $initlog for details"
23d314c Added new script to start/stop walrus and sc
graziano authored
374 fi
375 fi
376 ;;
377 esac
378 ;;
379 stop)
380 if [ "$VERBOSE" != no ]; then
381 if [ "$WE_HAVE_LSB" = "Y" ]; then
80f0b10 Uninstalling RPMs wouldn't stop the services anylonger: fixed.
graziano authored
382 log_daemon_msg "Stopping $DESC" "$NAME"
23d314c Added new script to start/stop walrus and sc
graziano authored
383 else
80f0b10 Uninstalling RPMs wouldn't stop the services anylonger: fixed.
graziano authored
384 echo -n "Stopping $DESC: $NAME"
23d314c Added new script to start/stop walrus and sc
graziano authored
385 fi
386 fi
0192439 @gholms Clean up trailing spaces
gholms authored
387
00941d7 better handling of --register-* in euca_conf
graziano authored
388 # let's check there is a previous cloud running
389 if ! do_status ; then
390 echo
92441f7 fixes RT: #3034 Incorrect error message is displayed when Eucalyptus …
Neil Soman authored
391 echo "No $DESC are running!"
00941d7 better handling of --register-* in euca_conf
graziano authored
392 if [ "$VERBOSE" != no ]; then
393 if [ "$WE_HAVE_LSB" = "Y" ]; then
394 log_end_msg 1
395 fi
396 fi
9e6fb10 init script fixes
root authored
397 exit 0
23d314c Added new script to start/stop walrus and sc
graziano authored
398 fi
399
8d720fc We use a master init.d script for the java ws and we generate the script
graziano authored
400 do_stop
2d839b7 use euca_conf to enable/disable ws starts/stop and use only one init
graziano authored
401
23d314c Added new script to start/stop walrus and sc
graziano authored
402 if [ "$VERBOSE" != no ]; then
403 if [ "$WE_HAVE_LSB" = "Y" ]; then
404 log_end_msg 0
405 else
406 echo "done."
407 fi
408 fi
409 ;;
410 restart)
a83c87f Cleaned up the restart and made the stop more quiet.
graziano authored
411 $0 stop
412 $0 start
0192439 @gholms Clean up trailing spaces
gholms authored
413 ;;
23d314c Added new script to start/stop walrus and sc
graziano authored
414 status)
415 if do_status ; then
1c86004 update to cloud init to prevent eucalyptus-cloud.pid race condition o…
root authored
416 echo "$DESC are running"
23d314c Added new script to start/stop walrus and sc
graziano authored
417 else
418 exit 3
419 fi
420 ;;
421 *)
efc277f Ready for more testing.
graziano authored
422 echo "Usage: $0 {start|stop|restart}" >&2
23d314c Added new script to start/stop walrus and sc
graziano authored
423 exit 3
424 ;;
425 esac
Something went wrong with that request. Please try again.