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 Feb 2008 18:41:46 -0000	[thread overview]
Message-ID: <20080205184146.27700.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2008-02-05 18:41:46

Modified files:
	luci/init.d    : luci 

Log message:
	pedantry

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/init.d/luci.diff?cvsroot=cluster&r1=1.20&r2=1.21

--- conga/luci/init.d/luci	2008/02/05 18:31:30	1.20
+++ conga/luci/init.d/luci	2008/02/05 18:41:46	1.21
@@ -73,12 +73,12 @@
 	old_umask=`umask`
 	umask 077
 
-	rm -f "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY"
+	rm -f -- "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY"
 	/usr/bin/openssl genrsa -out "$HTTPS_PRIVKEY" "$KEY_BITS" >&/dev/null
 	/usr/bin/openssl req -new -x509 -key "$HTTPS_PRIVKEY" -out "$HTTPS_PUBKEY" -days "$KEY_LIFE_DAYS" -config /var/lib/luci/var/certs/cacert.config
-	/bin/chmod 600 "$HTTPS_PRIVKEY"
-	/bin/chmod 644 "$HTTPS_PUBKEY"
-	/bin/chown $LUCI_USER:$LUCI_GROUP "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY"
+	/bin/chmod -- 600 "$HTTPS_PRIVKEY"
+	/bin/chmod -- 644 "$HTTPS_PUBKEY"
+	/bin/chown -- $LUCI_USER:$LUCI_GROUP "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY"
 	ret=$?
 
 	umask $old_umask
@@ -88,7 +88,7 @@
 
 stop_luci()
 {
-	pid_num=`cat $PIDFILE 2>/dev/null`
+	pid_num=`cat -- $PIDFILE 2>/dev/null`
 	ret=$?
 	if [ $ret -eq 0 ]; then
 		kill $pid_num >& /dev/null
@@ -96,7 +96,7 @@
 	fi
 
 	if [ $ret -ne 0 ]; then
-		pkill -u "$LUCI_USER" python >&/dev/null
+		pkill -u "$LUCI_USER" -- python >&/dev/null
 		ret=$?
 	fi
 	return $ret
@@ -104,7 +104,7 @@
 
 stop_stunnel()
 {
-	pid_num=`cat $STUNNEL_PID 2>/dev/null`
+	pid_num=`cat -- $STUNNEL_PID 2>/dev/null`
 	ret=$?
 	if [ $ret -eq 0 ]; then
 		kill $pid_num >& /dev/null
@@ -112,7 +112,7 @@
 	fi
 
 	if [ $ret -ne 0 ]; then
-		pkill -u "$LUCI_USER" stunnel >&/dev/null
+		pkill -u "$LUCI_USER" -- stunnel >&/dev/null
 		ret=$?
 	fi
 	return $ret
@@ -221,11 +221,11 @@
 	test -f "$PIDFILE"
 	LUCI_PID_EXISTS=$?
 	if [ "$LUCI_PID_EXISTS" -eq 0 ]; then
-		pgrep -u "$LUCI_USER" python >&/dev/null
+		pgrep -u "$LUCI_USER" -- python >&/dev/null
 		if [ $? -ne 0 ]; then
 			LUCI_UP=0
 			# remove stale pidfile
-			rm -f "$PIDFILE" >& /dev/null
+			rm -f -- "$PIDFILE" >& /dev/null
 		fi
 	else
 		LUCI_UP=0
@@ -237,14 +237,14 @@
 stunnel_running()
 {
 	ST_UP=2
-	pgrep -u "$LUCI_USER" stunnel >&/dev/null
+	pgrep -u "$LUCI_USER" -- stunnel >&/dev/null
 	if [ $? -ne 0 ]; then
 		ST_UP=0
 	fi
 
 	if [ -f "$STUNNEL_PID" ] && [ $ST_UP -eq 0 ]; then
 		# stale pidfile
-		rm -f "$STUNNEL_PID"
+		rm -f -- "$STUNNEL_PID"
 	fi
 	return $ST_UP
 }
@@ -290,7 +290,7 @@
 			echo "The admin user password must be set before the luci can start"
 			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')"
+			/usr/bin/logger -t "$ID" -- "Luci startup failed: admin password not set (execute 'luci_admin password')"
 			exit 6
 		fi
 
@@ -306,15 +306,15 @@
 			exit 0
 		elif [ $ret -gt 2 ]; then
 			# one of the two processes was running and couldn't be stopped.
-			/usr/bin/logger -t "$ID" "Luci startup failed: $errmsg"
+			/usr/bin/logger -t "$ID" -- "Luci startup failed: $errmsg"
 			exit 1
 		fi
 
 		system_running
 		if [ $? -eq 1 ]; then
 			echo_success
-			cat "$PIDFILE" > "$GLOB_PIDFILE"
-			touch "$GLOB_LOCKFILE"
+			cat -- "$PIDFILE" > "$GLOB_PIDFILE"
+			touch -- "$GLOB_LOCKFILE"
 			/usr/bin/logger -t "$ID" -- "Luci startup succeeded"
 			/usr/bin/logger -t "$ID" -- "Listening on port $LUCI_HTTPS_PORT; accessible via URL $LUCI_URL"
 			echo; echo
@@ -365,12 +365,12 @@
 		if [ $rtrn -eq 1 ]; then
 			stop
 			if [ $? -eq 0 ]; then
-				rm -f "$GLOB_PIDFILE"
-				rm -f "$GLOB_LOCKFILE"
-				/usr/bin/logger -t "$ID" "Luci shutdown succeeded"
+				rm -f -- "$GLOB_PIDFILE"
+				rm -f -- "$GLOB_LOCKFILE"
+				/usr/bin/logger -t "$ID" -- "Luci shutdown succeeded"
 				rtrn=0
 			else
-				/usr/bin/logger -t "$ID" "Luci shutdown failed"
+				/usr/bin/logger -t "$ID" -- "Luci shutdown failed"
 				rtrn=1
 			fi
 		elif [ $rtrn -eq 0 ]; then



             reply	other threads:[~2008-02-05 18:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05 18:41 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:31 rmccabe
2007-06-05 16:03 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=20080205184146.27700.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.