Author: tmckay
Date: 2011-05-20 21:43:17 +0000 (Fri, 20 May 2011)
New Revision: 4776
Modified:
trunk/cumin/etc/sysvinit-cumin
Log:
Perform cumin database server and environment checks only for
start commands, allow stop and status to work regardless.
BZ673273
Modified: trunk/cumin/etc/sysvinit-cumin
===================================================================
--- trunk/cumin/etc/sysvinit-cumin 2011-05-20 20:33:09 UTC (rev 4775)
+++ trunk/cumin/etc/sysvinit-cumin 2011-05-20 21:43:17 UTC (rev 4776)
@@ -8,28 +8,19 @@
#
# Sanity checks.
-test -x /usr/bin/cumin || exit 1
-test -x /usr/bin/cumin-database || exit 1
-
-SYSCONFIG="/etc/sysconfig/cumin"
-[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"
-
-cumin-database check-started &> /dev/null || {
- echo "Cumin's database server is not running"
- echo "Run 'cumin-database start' as root"
+test -x /usr/bin/cumin || {
+ echo "/usr/bin/cumin has been removed"
exit 1
}
-cumin-database check &> /dev/null || {
- # Run again with output left on for user.
- echo "Cumin's database is not yet installed"
- echo "Run 'cumin-database install' as root"
-
- echo "(detailed output from cumin-database check:)"
- cumin-database check noadvice
+test -x /usr/bin/cumin-database || {
+ echo "/usr/bin/cumin-database has been removed"
exit 1
}
+SYSCONFIG="/etc/sysconfig/cumin"
+[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"
+
# Source function library.
. /etc/rc.d/init.d/functions
@@ -40,6 +31,24 @@
RETVAL=0
start() {
+
+ # Initial checks for the start case
+ cumin-database check-started &> /dev/null || {
+ echo "Cumin's database server is not running"
+ echo "Run 'cumin-database start' as root"
+ exit 1
+ }
+
+ cumin-database check &> /dev/null || {
+ # Run again with output left on for user.
+ echo "Cumin's database is not yet installed"
+ echo "Run 'cumin-database install' as root"
+
+ echo "(detailed output from cumin-database check:)"
+ cumin-database check noadvice
+ exit 1
+ }
+
echo -n $"Starting cumin: "
# If it's already running, be happy and return success
status $processname &> /dev/null
Show replies by date