From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 5 Feb 2008 18:41:46 -0000 Subject: [Cluster-devel] conga/luci/init.d luci Message-ID: <20080205184146.27700.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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