Skip to content

Commit

Permalink
Made the init.d scripts less strict in checking dependencies if we are
Browse files Browse the repository at this point in the history
only stopping the services.
  • Loading branch information
graziano committed Nov 2, 2009
1 parent 66cd700 commit 2a1034d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 29 deletions.
11 changes: 4 additions & 7 deletions eucalyptus.spec
Expand Up @@ -157,7 +157,7 @@ make 2> err.log > out.log

%install
make install
ls /usr/share/eucalyptus/*jar|grep -v eucalyptus-walrus|grep -v eucalyptus-storagecontroller|grep -v eucalyptus-cloud > jar_list
ls /usr/share/eucalyptus/*jar > jar_list

%clean
make uninstall
Expand Down Expand Up @@ -199,13 +199,10 @@ rm -rf /usr/share/doc/eucalyptus-%{version}
/usr/sbin/eucalyptus-cloud

%files cloud
/usr/share/eucalyptus/eucalyptus-cloud-*.jar

%files walrus
/usr/share/eucalyptus/eucalyptus-walrus-*.jar

%files sc
/usr/share/eucalyptus/eucalyptus-storagecontroller-*.jar

%files cc
/opt/euca-axis2c/services/EucalyptusCC
Expand Down Expand Up @@ -356,7 +353,7 @@ then
[ -x /usr/sbin/euca_conf ] && /usr/sbin/euca_conf --disable cloud
if [ -e /etc/init.d/eucalyptus-cloud ];
then
/etc/init.d/eucalyptus-cloud restart
/etc/init.d/eucalyptus-cloud restart || true
fi
fi

Expand All @@ -367,7 +364,7 @@ then
[ -x /usr/sbin/euca_conf ] && /usr/sbin/euca_conf --disable walrus
if [ -e /etc/init.d/eucalyptus-cloud ];
then
/etc/init.d/eucalyptus-cloud restart
/etc/init.d/eucalyptus-cloud restart || true
fi
fi

Expand All @@ -377,7 +374,7 @@ then
[ -x /usr/sbin/euca_conf ] && /usr/sbin/euca_conf --disable sc
if [ -e /etc/init.d/eucalyptus-cloud ];
then
/etc/init.d/eucalyptus-cloud restart
/etc/init.d/eucalyptus-cloud restart || true
fi
fi

Expand Down
11 changes: 4 additions & 7 deletions tools/eucalyptus-cc.in
Expand Up @@ -108,13 +108,6 @@ if [ -z "$EUCALYPTUS" ] ; then
fi
export EUCALYPTUS

# just a quick way to check if we have the package still installed: at
# times we can still have the init.d script
if [ ! -x $EUCALYPTUS/usr/sbin/euca_conf ]; then
echo "Some eucalyptus components are missing"
exit 1
fi

create_httpd_config() {
IPS="all"

Expand All @@ -139,6 +132,10 @@ do_start() {
echo "cannot find httpd (was set to <$HTTPD>)!"
exit 1
fi
if [ ! -x $EUCALYPTUS/usr/sbin/euca_conf ]; then
echo "Some eucalyptus components are missing"
exit 1
fi

if ! $EUCALYPTUS/usr/sbin/euca_conf --check cc ; then
exit 1
Expand Down
28 changes: 20 additions & 8 deletions tools/eucalyptus-cloud.in
Expand Up @@ -129,20 +129,18 @@ if [ -r $EUCALYPTUS/etc/eucalyptus/eucalyptus.conf ]; then
echo "Warning: you should check EUCALYPTUS in conf file"
fi
else
# on removal of RPM we can get in a state in which the conf file
# is gone but the services are still running: make this hard
# failure only if we are not stopping
echo "Cannot find eucalyptus configuration file!"
exit 1
if [ "$1" != "stop" ]; then
exit 1
fi
fi
export EUCALYPTUS

pidfile=$EUCALYPTUS/var/run/eucalyptus/eucalyptus-cloud.pid

# just a quick way to check if we have the package still installed: at
# times we can still have the init.d script
if [ ! -x $EUCALYPTUS/usr/sbin/euca_conf ]; then
echo "Some eucalyptus components are missing"
exit 1
fi

# read in the services which should be running
read_ws_list() {
STORAGE_WS="N"
Expand Down Expand Up @@ -209,19 +207,33 @@ do_start() {
local OPTS=""

# basic checks
if [ ! -x $EUCALYPTUS/usr/sbin/euca_conf ]; then
echo "Some eucalyptus components are missing"
exit 1
fi

check_java

cd $EUCALYPTUS/etc/eucalyptus

# enabled services
if [ "$STORAGE_WS" != "Y" ]; then
OPTS="$OPTS --disable-storage"
if ! $EUCALYPTUS/usr/sbin/euca_conf --check sc ; then
exit 1
fi
fi
if [ "$WALRUS_WS" != "Y" ]; then
OPTS="$OPTS --disable-walrus"
if ! $EUCALYPTUS/usr/sbin/euca_conf --check walrus ; then
exit 1
fi
fi
if [ "$CLOUD_WS" != "Y" ]; then
OPTS="$OPTS --disable-cloud"
if ! $EUCALYPTUS/usr/sbin/euca_conf --check cloud ; then
exit 1
fi
fi

if [ "${STORAGE_WS}${CLOUD_WS}${WALRUS_WS}" = "NNN" ]; then
Expand Down
11 changes: 4 additions & 7 deletions tools/eucalyptus-nc.in
Expand Up @@ -111,13 +111,6 @@ if [ -z "$EUCALYPTUS" ] ; then
fi
export EUCALYPTUS

# just a quick way to check if we have the package still installed: at
# times we can still have the init.d script
if [ ! -x $EUCALYPTUS/usr/sbin/euca_conf ]; then
echo "Some eucalyptus components are missing"
exit 1
fi

create_httpd_config() {
IPS="all"

Expand Down Expand Up @@ -146,6 +139,10 @@ do_start() {
echo "cannot find httpd (was set to <$HTTPD>)!"
exit 1
fi
if [ ! -x $EUCALYPTUS/usr/sbin/euca_conf ]; then
echo "Some eucalyptus components are missing"
exit 1
fi

if ! $EUCALYPTUS/usr/sbin/euca_conf --check nc ; then
exit 1
Expand Down

0 comments on commit 2a1034d

Please sign in to comment.