Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
server:zope
zope3-python-2.4
zope3-python-2.4.init
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File zope3-python-2.4.init of Package zope3-python-2.4
#! /bin/sh # Copyright (c) 2004 SuSE Linux AG, Nuernberg, Germany. # # Authors: Michal Cihar <mcihar@suse.cz> # # init.d/zope # # and symbolic its link # # /usr/sbin/rczope # # System startup script for the Zope server # ### BEGIN INIT INFO # Provides: zope # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Start Zope server. ### END INIT INFO # Source Zope relevant things . /etc/sysconfig/zope3-python-2.4 INSTANCES="/var/opt/zope3" [ "$MANAGED_INSTANCES" ] || MANAGED_INSTANCES="ALL" [ "$ZOPE_SYSCONFIG" ] || ZOPE_SYSCONFIG="yes" [ "$ZOPE_HTTP_PORT" ] || ZOPE_HTTP_PORT="8080" [ "$ZOPE_FTP" ] || ZOPE_FTP="yes" [ "$ZOPE_FTP_PORT" ] || ZOPE_FTP_PORT="8021" [ "$ZOPE_PostmortemDebuggingHTTP" ] || ZOPE_PostmortemDebuggingHTTP="yes" [ "$ZOPE_PostmortemDebuggingHTTP_PORT" ] || ZOPE_PostmortemDebuggingHTTP_PORT="8090" if [ "$MANAGED_INSTANCES" = "ALL" ] ; then MANAGED_INSTANCES="$(find "$INSTANCES" -follow -mindepth 1 -maxdepth 1 -type d|sed s@$INSTANCES/\\?@@)" fi # Shell functions sourced from /etc/rc.status: # rc_check check and set local and overall rc status # rc_status check and set local and overall rc status # rc_status -v ditto but be verbose in local rc status # rc_status -v -r ditto and clear the local rc status # rc_failed set local and overall rc status to failed # rc_failed <num> set local and overall rc status to <num><num> # rc_reset clear local rc status (overall remains) # rc_exit exit appropriate to overall rc status . /etc/rc.status updateinstanceconfig () { # Should we manage configuration? if [ "$ZOPE_SYSCONFIG" != "yes" ] ; then return fi # Does zope.conf.in exists? if [ ! -f "$INSTANCES/default/etc/zope.conf.in" ] ; then echo echo "$INSTANCES/default/etc/zope.conf.in does not exist, can not manage default instance configuration!" return fi EXPR='' SERVERS="<server>\\n type HTTP\\n address $ZOPE_HTTP_PORT\\n</server>\\n\\n" if [ "$ZOPE_FTP" = "yes" ] ; then SERVERS="$SERVERS<server>\\n type FTP\\n address $ZOPE_FTP_PORT\\n</server>\\n\\n" fi if [ "$ZOPE_PostmortemDebuggingHTTP" = "yes" ] ; then SERVERS="$SERVERS<server>\\n type PostmortemDebuggingHTTP\\n address $ZOPE_PostmortemDebuggingHTTP_PORT\\n</server>\\n\\n" fi EXPR="$EXPR s@#SYSCONFIG_SERVERS#@$SERVERS@;" cat <<EOT > "$INSTANCES/default/etc/zope.conf" ############################################################################### # WARNING: Some parts of this file were generated, see /etc/sysconfig/zope3 # ############################################################################### EOT sed -e "$EXPR" "$INSTANCES/default/etc/zope.conf.in" >> "$INSTANCES/default/etc/zope.conf" } forallinstances () { for instance in $MANAGED_INSTANCES ; do echo -n "$instance " [ -d $instance ] || instance="$INSTANCES/$instance" if [ ! -d $instance ] ; then echo echo 'Instance was not found!' rc_failed fi if $instance/bin/zopectl $1 > /dev/null ; then true else rc_failed fi done } forallinstancesstatus () { TMPFILE=`mktemp` # in case we won't find any instance running rc_failed 3 for instance in $MANAGED_INSTANCES ; do echo -n "$instance: " [ -d $instance ] || instance="$INSTANCES/$instance" if [ ! -d $instance ] ; then echo echo 'Instance was not found!' rc_failed fi if $instance/bin/zopectl status > $TMPFILE ; then cat $TMPFILE if grep -q pid= $TMPFILE ; then # at least one is running rc_failed 0 fi else rc_failed fi done rm -f $TMPFILE } # First reset status of this service rc_reset # Return values acc. to LSB for all commands but status: # 0 - success # 1 - generic or unspecified error # 2 - invalid or excess argument(s) # 3 - unimplemented feature (e.g. "reload") # 4 - insufficient privilege # 5 - program is not installed # 6 - program is not configured # 7 - program is not running # # Note that starting an already running service, stopping # or restarting a not-running service as well as the restart # with force-reload (in case signalling is not supported) are # considered a success. case "$1" in start) echo -n "Starting zope, instances: " updateinstanceconfig forallinstances start rc_status -v ;; stop) echo -n "Shutting down zope, instances: " forallinstances stop rc_status -v ;; try-restart) updateinstanceconfig $0 stop >/dev/null && $0 restart rc_status ;; restart) echo -n "Restart service zope, instances: " updateinstanceconfig forallinstances restart rc_status -v ;; force-reload) echo -n "Reload service zope, instances: " forallinstances reload rc_status -v ;; reload) echo -n "Reload service zope, instances: " updateinstanceconfig forallinstances reload rc_status -v ;; status) echo "Checking for zope instances:" forallinstancesstatus rc_status -v ;; logrotate) echo "Reopening zope logs:" forallinstances logreopen rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload}" exit 1 ;; esac rc_exit
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor