[csw-devel] SF.net SVN: gar:[7606] csw/mgar/pkg/nginx/trunk/files
aigoshin at users.sourceforge.net
aigoshin at users.sourceforge.net
Sat Dec 12 15:28:59 CET 2009
Revision: 7606
http://gar.svn.sourceforge.net/gar/?rev=7606&view=rev
Author: aigoshin
Date: 2009-12-12 14:28:59 +0000 (Sat, 12 Dec 2009)
Log Message:
-----------
nginx: milestone 4.5
Added Paths:
-----------
csw/mgar/pkg/nginx/trunk/files/cswnginx
Removed Paths:
-------------
csw/mgar/pkg/nginx/trunk/files/CSWnginx.checkinstall
csw/mgar/pkg/nginx/trunk/files/CSWnginx.postinstall
csw/mgar/pkg/nginx/trunk/files/CSWnginx.preremove
csw/mgar/pkg/nginx/trunk/files/cswnginx.xml
csw/mgar/pkg/nginx/trunk/files/svc-cswnginx
Deleted: csw/mgar/pkg/nginx/trunk/files/CSWnginx.checkinstall
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/CSWnginx.checkinstall 2009-12-12 14:24:46 UTC (rev 7605)
+++ csw/mgar/pkg/nginx/trunk/files/CSWnginx.checkinstall 2009-12-12 14:28:59 UTC (rev 7606)
@@ -1,47 +0,0 @@
-#!/sbin/sh
-#################################################################################
-# CUSTOM SECTION
-#################################################################################
-
-UPGRADE_NGINX="0"
-
-SMF="no"
-test -f $BASEDIR/usr/sbin/svccfg -a -f $BASEDIR/usr/sbin/svcadm && SMF="yes"
-
-if [ "$SMF" = "yes" ]; then
- STATE=`$BASEDIR/usr/bin/svcs -Ho STATE nginx 2>/dev/null`
- if [ $? -eq 0 ]; then
- echo "nginx service is in '$STATE' state"
- if [ "$STATE" = "online" ]; then
- if [ -x "$BASEDIR/opt/csw/lib/svc/method/svc-cswnginx" ]; then
- NXSTATE=`$BASEDIR/opt/csw/lib/svc/method/svc-cswnginx status`
- echo "nginx is $NXSTATE"
- if [ "$NXSTATE" = "running" ]; then
- echo "nginx online upgrade is requested"
- UPGRADE_NGINX="1"
- fi
- fi
- fi
- fi
-else
- if [ -x $BASEDIR/etc/init.d/cswnginx ]; then
- NXSTATE=`$BASEDIR/etc/init.d/cswnginx status`
- echo "nginx is $NXSTATE"
- if [ "$NXSTATE" = "running" ]; then
- echo "nginx online upgrade is requested"
- UPGRADE_NGINX="1"
- fi
- fi
-fi
-
-
-# Make env variables available to other packaging scripts
-
-cat >$1 <<!
-UPGRADE_NGINX='$UPGRADE_NGINX'
-!
-
-#################################################################################
-# END CUSTOM SECTION
-#################################################################################
-
Deleted: csw/mgar/pkg/nginx/trunk/files/CSWnginx.postinstall
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/CSWnginx.postinstall 2009-12-12 14:24:46 UTC (rev 7605)
+++ csw/mgar/pkg/nginx/trunk/files/CSWnginx.postinstall 2009-12-12 14:28:59 UTC (rev 7606)
@@ -1,56 +0,0 @@
-#!/sbin/sh
-#################################################################################
-# CUSTOM SECTION
-#################################################################################
-
-if [ $UPGRADE_NGINX -eq 1 ]; then
- MSG=""
- UPGRADE_NGINX_ERR=0
- if [ "$SMF" = "yes" ]; then
- CSWNGINX="/opt/csw/lib/svc/method/svc-cswnginx"
- else
- CSWNGINX="/etc/init.d/cswnginx"
- fi
- if [ -x "${BASEDIR}${CSWNGINX}" ]; then
- MSG=`$CSWNGINX upgrade`
- if [ $? -ne 0 ]; then
- UPGRADE_NGINX_ERR=1
- fi
- fi
-
- if [ $UPGRADE_NGINX_ERR -eq 0 ]; then
- echo " "
- echo "nginx was upgraded"
- echo " "
- echo "If this new version of nginx works properly please run"
- echo "'$CSWNGINX upgrade-commit'"
- echo "to finalize the online upgrade process."
- echo " "
- echo "If there are problems with new version you can rollback"
- echo "to the old version (which is still running) by command"
- echo "'$CSWNGINX upgrade-rollback'"
- echo "and subsequent reinstallation of the old package."
- echo " "
- echo "More details can be found in the nginx documentation:"
- echo "http://sysoev.ru/nginx/docs/control.html"
- else
- echo " "
- echo "nginx was NOT upgraded"
- echo "$MSG"
- fi
-else
- echo " "
- echo "This package may use online upgrade feature of nginx which allows"
- echo "not to interrupt the processing of clients requests during the nginx"
- echo "version upgrade. To use it you should install the package over the"
- echo "existing version (without preliminary removing)."
- echo " "
- echo "NOTE: if you wish to take advantage of nginx online upgrade feature"
- echo "you should NOT use CSW automatic package update since it sequently"
- echo "runs pkgrm/pkgadd."
-fi
-
-#################################################################################
-# END CUSTOM SECTION
-#################################################################################
-
Deleted: csw/mgar/pkg/nginx/trunk/files/CSWnginx.preremove
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/CSWnginx.preremove 2009-12-12 14:24:46 UTC (rev 7605)
+++ csw/mgar/pkg/nginx/trunk/files/CSWnginx.preremove 2009-12-12 14:28:59 UTC (rev 7606)
@@ -1,37 +0,0 @@
-#!/sbin/sh
-#################################################################################
-# CUSTOM SECTION
-#################################################################################
-
-case "$PKG_ROOT_DIR" in
- ""|"/")
- if [ "$SMF" = "yes" ]; then
- echo "stopping nginx service..."
- $BASEDIR/usr/sbin/svcadm disable -s nginx
- else
- echo "stopping nginx..."
- test -x $BASEDIR/etc/init.d/cswnginx && $BASEDIR/etc/init.d/cswnginx stop
- fi
- ;;
-esac
-
-for CONF_FILE in $SERVICE_CONF_FILES; do
- test -r ${CONF_FILE}.CSW || continue
- /bin/diff $CONF_FILE ${CONF_FILE}.CSW >/dev/null 2>&1
- case "$?" in
- 0)
- echo "removing unmodified $CONF_FILE"
- rm -f $CONF_FILE
- ;;
- 1)
- echo "not touching modified $CONF_FILE"
- ;;
- *)
- ;;
- esac
-done
-
-#################################################################################
-# END CUSTOM SECTION
-#################################################################################
-
Added: csw/mgar/pkg/nginx/trunk/files/cswnginx
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/cswnginx (rev 0)
+++ csw/mgar/pkg/nginx/trunk/files/cswnginx 2009-12-12 14:28:59 UTC (rev 7606)
@@ -0,0 +1,172 @@
+#!/bin/sh
+#
+# SMF Method file for nginx
+#
+
+NGINX=/opt/csw/sbin/nginx
+CFGFILE=/etc/opt/csw/nginx/nginx.conf
+VARRUNX=/var/run/nginx
+PIDFILE=${VARRUNX}/nginx.pid
+PIDFILO=${VARRUNX}/nginx.pid.oldbin
+
+[ ! -f ${NGINX} ] && exit 255
+[ ! -f ${CFGFILE} ] && exit 254
+
+RETVAL=0
+
+start() {
+ $NGINX
+ RETVAL=$?
+ return $RETVAL
+}
+
+stop() {
+ killpidf -TERM $PIDFILO
+ killpidf -TERM
+}
+
+check() {
+ MSG=`$NGINX -t 2>&1`
+ RETVAL=$?
+ [ $RETVAL -ne 0 ] && echo $MSG
+ return $RETVAL
+}
+
+killpidf() {
+ if [ "$2" != "" ]; then
+ PIDF=$2
+ else
+ PIDF=$PIDFILE
+ fi
+ if [ -s "$PIDF" ]; then
+ /bin/kill $1 `/usr/bin/cat $PIDF`
+ RETVAL=$?
+ else
+ RETVAL=1
+ fi
+ return $RETVAL
+}
+
+reload() {
+ killpidf -HUP
+ return $RETVAL
+}
+
+restart() {
+ stop
+ start
+ return $RETVAL
+}
+
+rotate() {
+ killpidf -USR1
+ return $RETVAL
+}
+
+status() {
+ if [ -s "$PIDFILE" ]; then
+ FPID=`/bin/cat $PIDFILE`
+ else
+ echo "not running"
+ RETVAL=1
+ return $RETVAL
+ fi
+ PIDP=`/bin/ps -o pid= -p $FPID`
+ if [ "$PIDP" = "" ]; then
+ echo "not running"
+ RETVAL=1
+ return $RETVAL
+ fi
+ COMM=`/bin/ps -o comm= -p $FPID`
+ if [ "$NGINX" = "$COMM" ]; then
+ echo "running"
+ RETVAL=0
+ return $RETVAL
+ else
+ echo "running, but it is not a CSW package"
+ RETVAL=1
+ return $RETVAL
+ fi
+}
+
+upgrade()
+{
+ killpidf -USR2
+ [ $RETVAL -ne 0 ] && return $RETVAL
+ OLDBINPID=0
+ for i in 1 2 3 4 5; do
+ if [ -s $PIDFILO ]; then
+ OLDBINPID=1
+ sleep 2
+ break
+ else
+ sleep 1
+ fi
+ done
+ if [ $OLDBINPID -eq 1 ]; then
+ status >/dev/null
+ if [ $RETVAL -eq 0 ]; then
+ killpidf -WINCH $PIDFILO
+ fi
+ else
+ RETVAL=1
+ fi
+ return $RETVAL
+}
+
+upgrade_commit()
+{
+ killpidf -QUIT $PIDFILO
+ return $RETVAL
+}
+
+upgrade_rollback()
+{
+ killpidf -HUP $PIDFILO
+ if [ $RETVAL -eq 0 ]; then
+ killpidf -QUIT $PIDFILE
+ fi
+ return $RETVAL
+}
+
+
+case "$1" in
+start)
+ [ ! -d $VARRUNX ] && /bin/mkdir -p $VARRUNX ||:
+ check
+ [ $RETVAL -eq 0 ] && start ||:
+ ;;
+stop)
+ stop
+ ;;
+refresh|reload)
+ check
+ [ $RETVAL -eq 0 ] && reload ||:
+ ;;
+restart)
+ check
+ [ $RETVAL -eq 0 ] && restart ||:
+ ;;
+rotate)
+ rotate
+ ;;
+status)
+ status
+ ;;
+upgrade)
+ check
+ [ $RETVAL -eq 0 ] && upgrade ||:
+ ;;
+upgrade-commit)
+ upgrade_commit
+ ;;
+upgrade-rollback)
+ upgrade_rollback
+ ;;
+*)
+ echo "Usage:" `basename $0` "{start|stop|refresh|reload|restart|rotate|status|upgrade|upgrade-commit|upgrade-rollback}"
+ exit 1
+ ;;
+esac
+
+exit $RETVAL
Property changes on: csw/mgar/pkg/nginx/trunk/files/cswnginx
___________________________________________________________________
Added: svn:executable
+ *
Deleted: csw/mgar/pkg/nginx/trunk/files/cswnginx.xml
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/cswnginx.xml 2009-12-12 14:24:46 UTC (rev 7605)
+++ csw/mgar/pkg/nginx/trunk/files/cswnginx.xml 2009-12-12 14:28:59 UTC (rev 7606)
@@ -1,76 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
-<!--
- nginx manifest
--->
-
-<service_bundle type='manifest' name='nginx'>
-
-<service
- name='network/nginx'
- type='service'
- version='1'>
-
- <instance name='nginx' enabled='false'>
- <dependency name='loopback'
- grouping='require_all'
- restart_on='error'
- type='service'>
- <service_fmri value='svc:/network/loopback:default'/>
- </dependency>
-
- <dependency name='physical'
- grouping='optional_all'
- restart_on='error'
- type='service'>
- <service_fmri value='svc:/network/physical:default'/>
- </dependency>
-
- <dependency name='multiuser-server'
- grouping='require_all'
- restart_on='error'
- type='service'>
- <service_fmri value='svc:/milestone/multi-user-server:default'/>
- </dependency>
-
- <exec_method
- type='method'
- name='start'
- exec='/opt/csw/lib/svc/method/svc-cswnginx start'
- timeout_seconds='60' />
-
- <exec_method
- type='method'
- name='stop'
- exec='/opt/csw/lib/svc/method/svc-cswnginx stop'
- timeout_seconds='60' />
-
- <exec_method
- type='method'
- name='refresh'
- exec='/opt/csw/lib/svc/method/svc-cswnginx refresh'
- timeout_seconds='60' />
-
- <property_group name='startd' type='framework'>
- <!-- sub-process core dumps shouldn't restart
- session -->
- <propval name='ignore_error' type='astring'
- value='core,signal' />
- </property_group>
-
- </instance>
-
- <template>
- <common_name>
- <loctext xml:lang='C'>
- nginx HTTP server and mail proxy server
- </loctext>
- </common_name>
- <documentation>
- <doc_link name='nginx docs'
- uri='http://sysoev.ru/nginx/docs/' />
- </documentation>
- </template>
-</service>
-
-</service_bundle>
Deleted: csw/mgar/pkg/nginx/trunk/files/svc-cswnginx
===================================================================
--- csw/mgar/pkg/nginx/trunk/files/svc-cswnginx 2009-12-12 14:24:46 UTC (rev 7605)
+++ csw/mgar/pkg/nginx/trunk/files/svc-cswnginx 2009-12-12 14:28:59 UTC (rev 7606)
@@ -1,172 +0,0 @@
-#!/bin/sh
-#
-# SMF Method file for nginx
-#
-
-NGINX=/opt/csw/sbin/nginx
-CFGFILE=/opt/csw/etc/nginx/nginx.conf
-VARRUNX=/opt/csw/var/run/nginx
-PIDFILE=${VARRUNX}/nginx.pid
-PIDFILO=${VARRUNX}/nginx.pid.oldbin
-
-[ ! -f ${NGINX} ] && exit 255
-[ ! -f ${CFGFILE} ] && exit 254
-
-RETVAL=0
-
-start() {
- $NGINX
- RETVAL=$?
- return $RETVAL
-}
-
-stop() {
- killpidf -TERM $PIDFILO
- killpidf -TERM
-}
-
-check() {
- MSG=`$NGINX -t 2>&1`
- RETVAL=$?
- [ $RETVAL -ne 0 ] && echo $MSG
- return $RETVAL
-}
-
-killpidf() {
- if [ "$2" != "" ]; then
- PIDF=$2
- else
- PIDF=$PIDFILE
- fi
- if [ -s "$PIDF" ]; then
- /bin/kill $1 `/usr/bin/cat $PIDF`
- RETVAL=$?
- else
- RETVAL=1
- fi
- return $RETVAL
-}
-
-reload() {
- killpidf -HUP
- return $RETVAL
-}
-
-restart() {
- stop
- start
- return $RETVAL
-}
-
-rotate() {
- killpidf -USR1
- return $RETVAL
-}
-
-status() {
- if [ -s "$PIDFILE" ]; then
- FPID=`/bin/cat $PIDFILE`
- else
- echo "not running"
- RETVAL=1
- return $RETVAL
- fi
- PIDP=`/bin/ps -o pid= -p $FPID`
- if [ "$PIDP" = "" ]; then
- echo "not running"
- RETVAL=1
- return $RETVAL
- fi
- COMM=`/bin/ps -o comm= -p $FPID`
- if [ "$NGINX" = "$COMM" ]; then
- echo "running"
- RETVAL=0
- return $RETVAL
- else
- echo "running, but it is not a CSW package"
- RETVAL=1
- return $RETVAL
- fi
-}
-
-upgrade()
-{
- killpidf -USR2
- [ $RETVAL -ne 0 ] && return $RETVAL
- OLDBINPID=0
- for i in 1 2 3 4 5; do
- if [ -s $PIDFILO ]; then
- OLDBINPID=1
- sleep 2
- break
- else
- sleep 1
- fi
- done
- if [ $OLDBINPID -eq 1 ]; then
- status >/dev/null
- if [ $RETVAL -eq 0 ]; then
- killpidf -WINCH $PIDFILO
- fi
- else
- RETVAL=1
- fi
- return $RETVAL
-}
-
-upgrade_commit()
-{
- killpidf -QUIT $PIDFILO
- return $RETVAL
-}
-
-upgrade_rollback()
-{
- killpidf -HUP $PIDFILO
- if [ $RETVAL -eq 0 ]; then
- killpidf -QUIT $PIDFILE
- fi
- return $RETVAL
-}
-
-
-case "$1" in
-start)
- [ ! -d $VARRUNX ] && /bin/mkdir -p $VARRUNX ||:
- check
- [ $RETVAL -eq 0 ] && start ||:
- ;;
-stop)
- stop
- ;;
-refresh|reload)
- check
- [ $RETVAL -eq 0 ] && reload ||:
- ;;
-restart)
- check
- [ $RETVAL -eq 0 ] && restart ||:
- ;;
-rotate)
- rotate
- ;;
-status)
- status
- ;;
-upgrade)
- check
- [ $RETVAL -eq 0 ] && upgrade ||:
- ;;
-upgrade-commit)
- upgrade_commit
- ;;
-upgrade-rollback)
- upgrade_rollback
- ;;
-*)
- echo "Usage:" `basename $0` "{start|stop|refresh|reload|restart|rotate|status|upgrade|upgrade-commit|upgrade-rollback}"
- exit 1
- ;;
-esac
-
-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