All of lore.kernel.org
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/init.d luci
Date: 5 Jun 2007 16:03:33 -0000	[thread overview]
Message-ID: <20070605160333.14915.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	EXPERIMENTAL
Changes by:	rmccabe at sourceware.org	2007-06-05 16:03:33

Modified files:
	luci/init.d    : luci 

Log message:
	fix bz242668 (luci init script can return non-LSB-compliant return codes)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/init.d/luci.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.16.2.1&r2=1.16.2.2

--- conga/luci/init.d/luci	2007/05/22 01:39:51	1.16.2.1
+++ conga/luci/init.d/luci	2007/06/05 16:03:33	1.16.2.2
@@ -46,12 +46,12 @@
 #
 # Only root wants to run this...
 #
-[ `id -u` = 0 ] || exit 0
+[ `id -u` = 0 ] || exit 4
 
 #
 # If we're not configured, then don't start anything.
 #
-[ "${NETWORKING}" = "yes" ] || exit 0
+[ "${NETWORKING}" = "yes" ] || exit 1
 
 
 https_certs_ok()
@@ -221,13 +221,14 @@
 
 case $1 in
 	start)
-		if ! /bin/grep True /var/lib/luci/.default_password_has_been_reset 2>&1 >/dev/null; then
+		grep True /var/lib/luci/.default_password_has_been_reset >&/dev/null
+		if [ $? -ne 0 ]; then
 			echo ""
 			echo "The admin user password must be set before the luci can start"
-			echo "To do so, execute (as root): "
+			echo "To set it, execute (as root): "
 			echo -e "\tluci_admin password\n"
 			/usr/bin/logger -t "$ID" "Luci startup failed: admin password not set (execute 'luci_admin password')"
-			exit 1
+			exit 6
 		fi
 
 		echo -n "Starting $ID: "
@@ -256,17 +257,19 @@
 			echo; echo
 			echo "Point your web browser to $LUCI_URL to access luci"
 			echo
+			exit 0
 		else
 			echo_failure
 			/usr/bin/logger -t "$ID" "Luci startup failed $errmsg"
 			echo
+			exit 1
 		fi
 	;;
 
 	restart)
 		$0 stop
 		rtrn=$?
-		if [ $rtrn -eq 0 ]; then
+		if [ $rtrn -eq 0 ] || [ $rtrn -eq 7 ]; then
 			$0 start
 			rtrn=$?
 		fi
@@ -275,7 +278,7 @@
 	condrestart)
 		system_running
 		rtrn=$?
-		if [ $? -eq 1 ] ; then
+		if [ $rtrn -eq 1 ]; then
 			$0 restart
 			rtrn=$?
 		fi
@@ -288,7 +291,7 @@
 			rtrn=0
 		else
 			echo "$ID is stopped"
-			rtrn=1
+			rtrn=7
 		fi
 	;;
 
@@ -305,8 +308,14 @@
 				rtrn=0
 			else
 				/usr/bin/logger -t "$ID" "Luci shutdown failed"
+				rtrn=1
 			fi
+		elif [ $rtrn -eq 0 ]; then
+			rtrn=7
+		else
+			rtrn=1
 		fi
+
 		if [ $rtrn -eq 0 ]; then
 			echo_success
 		else
@@ -316,12 +325,12 @@
 	;;
 
 	reload)
-		rtrn=0
+		rtrn=3
 	;;
 
 	*)
 		echo "Usage: $0 {start|stop|status|restart|condrestart|reload}"
-		rtrn=1
+		rtrn=3
 	;;
 esac
 



             reply	other threads:[~2007-06-05 16:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 16:03 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-02-04 23:36 [Cluster-devel] conga/luci/init.d luci rmccabe
2008-02-05 18:41 rmccabe
2008-02-05 18:31 rmccabe
2007-05-22  1:39 rmccabe
2007-03-15 16:52 rmccabe
2007-02-20 17:56 rmccabe
2006-11-02  0:23 kupcevic
2006-10-03 18:23 kupcevic
2006-09-26  0:22 kupcevic
2006-07-17 20:56 kupcevic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070605160333.14915.qmail@sourceware.org \
    --to=rmccabe@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.