[csw-devel] SF.net SVN: gar:[4682] csw/mgar/pkg/nginx/trunk

aigoshin at users.sourceforge.net aigoshin at users.sourceforge.net
Tue May 5 14:28:05 CEST 2009


Revision: 4682
          http://gar.svn.sourceforge.net/gar/?rev=4682&view=rev
Author:   aigoshin
Date:     2009-05-05 12:28:05 +0000 (Tue, 05 May 2009)

Log Message:
-----------
nginx: milestone 3.0

Modified Paths:
--------------
    csw/mgar/pkg/nginx/trunk/Makefile
    csw/mgar/pkg/nginx/trunk/checksums
    csw/mgar/pkg/nginx/trunk/files/CSWnginx.postinstall
    csw/mgar/pkg/nginx/trunk/files/svc-cswnginx

Modified: csw/mgar/pkg/nginx/trunk/Makefile
===================================================================
--- csw/mgar/pkg/nginx/trunk/Makefile	2009-05-05 02:47:36 UTC (rev 4681)
+++ csw/mgar/pkg/nginx/trunk/Makefile	2009-05-05 12:28:05 UTC (rev 4682)
@@ -1,8 +1,8 @@
 GARNAME = nginx
-GARVERSION = 0.7.30
+GARVERSION = $(NGINX_VERSION)
 CATEGORIES = server
 
-DESCRIPTION = nginx HTTP server and mail proxy server
+DESCRIPTION = HTTP server and mail proxy server
 define BLURB
   Nginx (pronounced "engine x") is a free, open-source, high-performance
   HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server.

Modified: csw/mgar/pkg/nginx/trunk/checksums
===================================================================
--- csw/mgar/pkg/nginx/trunk/checksums	2009-05-05 02:47:36 UTC (rev 4681)
+++ csw/mgar/pkg/nginx/trunk/checksums	2009-05-05 12:28:05 UTC (rev 4682)
@@ -1,7 +1,7 @@
-31d26f66824fd2d3f33ac0b3b9db1532  download/nginx-0.7.30.tar.gz
+521cd4c0248aebfdb25df48a11a8cc49  download/CSWnginx.checkinstall
 12b5333e18e985b17f8a5465646e9a8a  download/CSWnginx.gspec
-521cd4c0248aebfdb25df48a11a8cc49  download/CSWnginx.checkinstall
-1e505987ba8df7f61f21fc28b926fc5a  download/CSWnginx.postinstall
+bb404771e330fe98f93cb2d12a808121  download/CSWnginx.postinstall
 e9178dc33f2d38aab8f118a8f0550ac7  download/CSWnginx.preremove
 5c832758a62ee319ea9dfd1829d736eb  download/cswnginx.xml
-706889f6967b3b327c14aa0ff5c271ab  download/svc-cswnginx
+15cce6102a2efcf4d4acde9bb71ea6d3  download/nginx-0.6.36.tar.gz
+02b720d1ff091b7d2ab005b4db223345  download/svc-cswnginx

Modified: csw/mgar/pkg/nginx/trunk/files/CSWnginx.postinstall
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/CSWnginx.postinstall	2009-05-05 02:47:36 UTC (rev 4681)
+++ csw/mgar/pkg/nginx/trunk/files/CSWnginx.postinstall	2009-05-05 12:28:05 UTC (rev 4682)
@@ -7,11 +7,11 @@
 	MSG=""
 	UPGRADE_NGINX_ERR=0
 	if [ "$SMF" = "yes" ]; then
-		CSWNGINX="$BASEDIR/opt/csw/lib/svc/method/svc-cswnginx"
+		CSWNGINX="/opt/csw/lib/svc/method/svc-cswnginx"
 	else
-		CSWNGINX="$BASEDIR/etc/init.d/cswnginx"
+		CSWNGINX="/etc/init.d/cswnginx"
 	fi
-	if [ -x $CSWNGINX ]; then
+	if [ -x "${BASEDIR}${CSWNGINX}" ]; then
 		MSG=`$CSWNGINX upgrade`
 		if [ $? -ne 0 ]; then
 			UPGRADE_NGINX_ERR=1

Modified: csw/mgar/pkg/nginx/trunk/files/svc-cswnginx
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/svc-cswnginx	2009-05-05 02:47:36 UTC (rev 4681)
+++ csw/mgar/pkg/nginx/trunk/files/svc-cswnginx	2009-05-05 12:28:05 UTC (rev 4682)
@@ -9,9 +9,10 @@
 PIDFILE=${VARRUNX}/nginx.pid
 PIDFILO=${VARRUNX}/nginx.pid.oldbin
 
-#[ ! -f ${NGINX} ]   && exit 255
-#[ ! -f ${CFGFILE} ] && exit 254
+[ ! -f ${NGINX} ]   && exit 255
+[ ! -f ${CFGFILE} ] && exit 254
 
+RETVAL=0
 
 start() {
 	$NGINX
@@ -48,49 +49,49 @@
 
 reload() {
 	killpidf -HUP
-	RETVAL=$?
 	return $RETVAL
 }
 
 restart() {
 	stop
 	start
-	RETVAL=$?
 	return $RETVAL
 }
 
 rotate() {
 	killpidf -USR1
-	RETVAL=$?
 	return $RETVAL
 }
 
-state() {
+status() {
 	if [ -s "$PIDFILE" ]; then
 		FPID=`/bin/cat $PIDFILE`
 	else
 		echo "not running"
-		return 1
+		RETVAL=1
+		return $RETVAL
 	fi
 	PIDP=`/bin/ps -o pid= -p $FPID`
 	if [ "$PIDP" = "" ]; then
 		echo "not running"
-		return 1
+		RETVAL=1
+		return $RETVAL
 	fi
 	COMM=`/bin/ps -o comm= -p $FPID`
 	if [ "$NGINX" = "$COMM" ]; then
 		echo "running"
-		return 0
+		RETVAL=0
+		return $RETVAL
 	else
 		echo "running, but it is not a CSW package"
-		return 1
+		RETVAL=1
+		return $RETVAL
 	fi
 }
 
 upgrade()
 {
 	killpidf -USR2
-	RETVAL=$?
 	[ $RETVAL -ne 0 ] && return $RETVAL
 	OLDBINPID=0
 	for i in 1 2 3 4 5; do
@@ -102,31 +103,27 @@
 		fi
 	done
 	if [ $OLDBINPID -eq 1 ]; then
-		state >/dev/null
-		RETVAL=$?
+		status >/dev/null
 		if [ $RETVAL -eq 0 ]; then
 			killpidf -WINCH $PIDFILO
-			RETVAL=$?
 		fi
-		return $RETVAL
+	else
+		RETVAL=1
 	fi
-	return 1
+	return $RETVAL
 }
 
 upgrade_commit()
 {
 	killpidf -QUIT $PIDFILO
-	RETVAL=$?
 	return $RETVAL
 }
 
 upgrade_rollback()
 {
 	killpidf -HUP $PIDFILO
-	RETVAL=$?
 	if [ $RETVAL -eq 0 ]; then
 		killpidf -QUIT $PIDFILE
-		RETVAL=$?
 	fi
 	return $RETVAL
 }
@@ -134,50 +131,41 @@
 
 case "$1" in
 start)
-	[ ! -d $VARRUNX ] && /bin/mkdir -p $VARRUNX
+	[ ! -d $VARRUNX ] && /bin/mkdir -p $VARRUNX ||:
 	check
-	start
-	RETVAL=$?
+	[ $RETVAL -eq 0 ] && start ||:
 	;;
 stop)
 	stop
 	;;
 refresh|reload)
 	check
-	RETVAL=$?
 	[ $RETVAL -eq 0 ] && reload ||:
 	;;
 restart)
 	check
-	RETVAL=$?
 	[ $RETVAL -eq 0 ] && restart ||:
 	;;
 rotate)
 	rotate
-	RETVAL=$?
 	;;
-state)
-	state
-	RETVAL=$?
+status)
+	status
 	;;
 upgrade)
 	check
-	RETVAL=$?
 	[ $RETVAL -eq 0 ] && upgrade ||:
 	;;
 upgrade-commit)
 	upgrade_commit
-	RETVAL=$?
 	;;
 upgrade-rollback)
 	upgrade_rollback
-	RETVAL=$?
 	;;
 *)
-	echo "Usage:" `basename $0` "{start|stop|refresh|reload|restart|rotate|state|upgrade|upgrade-commit|upgrade-rollback}"
+	echo "Usage:" `basename $0` "{start|stop|refresh|reload|restart|rotate|status|upgrade|upgrade-commit|upgrade-rollback}"
 	exit 1
 	;;
 esac
 
-RETVAL=$?
 exit $RETVAL


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list