vendor/zasync/1.1

changeset 28:2a2560b5f19a 1.1-nux 0.0.4-1.1-nux

Modified zasync start/stop script to be used under /etc/rc.d/init.d
author rspivak
date Mon, 20 Feb 2006 13:39:01 +0000
parents 66fb0ec30518
children c4481c2a7318
files CHANGES bin/zasync
diffstat 2 files changed, 17 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/CHANGES
     1.2 +++ b/CHANGES
     1.3 @@ -10,4 +10,4 @@
     1.4    run/kill methods.
     1.5  New internal features:
     1.6  ~~~~~~~~~~~~~~~~~~~~~~
     1.7 --
     1.8 +- Modified zasync start/stop script to be used under /etc/rc.d/init.d
     2.1 --- a/bin/zasync
     2.2 +++ b/bin/zasync
     2.3 @@ -1,19 +1,31 @@
     2.4  #! /bin/sh
     2.5  
     2.6 +# change these paths to match your installation
     2.7 +ZOPE_HOME="/opt/Zope-2.8"
     2.8 +PYTHON="${ZOPE_HOME}/bin/python"
     2.9 +INSTANCE_HOME="/var/zope"
    2.10 +
    2.11 +CONFIG_FILE="${INSTANCE_HOME}/etc/zasync.conf"
    2.12 +
    2.13 +SOFTWARE_HOME="${ZOPE_HOME}/lib/python"
    2.14 +CLIENT_HOME="${INSTANCE_HOME}/Products/zasync/client"
    2.15 +PYTHONPATH="${INSTANCE_HOME}/bin:${CLIENT_HOME}:${SOFTWARE_HOME}"
    2.16 +export PYTHONPATH INSTANCE_HOME
    2.17 +
    2.18  # Script suitable for adding to /etc/rc.d/init.d
    2.19 -return=$rc_done
    2.20 +return=0
    2.21  case "$1" in
    2.22      start)
    2.23  	echo -n "Starting service for Zope Asynchronous Call Manager"
    2.24  	## the echo return value is set appropriately.
    2.25 -	( /home2/FIBU/Zope2.7/instances/bin/startzasync & ) || return=$rc_failed
    2.26 +	( $PYTHON -c "from zasyncctl import run;run('$CONFIG_FILE')" & ) || return=1
    2.27  	echo -e "$return"
    2.28  	;;
    2.29      stop)
    2.30  	echo -n "Shutting down service for Zope Asynchronous Call Manager"
    2.31  	echo -n "This can take a while."
    2.32  	## the echo return value is set appropriately.
    2.33 -	/home2/FIBU/Zope2.7/instances/bin/stopzasync || return=$rc_failed
    2.34 +	( $PYTHON -c "from zasyncctl import kill;kill('$CONFIG_FILE')" ) || return=1
    2.35  	echo -e "$return"
    2.36  	;;
    2.37      *)
    2.38 @@ -23,5 +35,5 @@
    2.39  esac
    2.40  
    2.41  # Inform the caller not only verbosely and set an exit status.
    2.42 -test "$return" = "$rc_done" || exit 1
    2.43 +test "$return" = 0 || exit 1
    2.44  exit 0