5 # description: Starts and stops the Zope instances
10 # Source function library.
11 . /etc/rc.d/init.d/functions
13 # Source networking configuration.
14 . /etc/sysconfig/network
16 # Check that networking is up.
17 if is_yes "${NETWORKING}"; then
18 if [ ! -f /var/lock/subsys/network ]; then
19 msg_network_down "Zope 3"
28 [ -f /etc/sysconfig/zope3 ] && . /etc/sysconfig/zope3
36 typeset -i exit_code=0
39 if ! cd "$instance_home/var" 2>/dev/null ; then
43 errors="Cannot chdir to $instance_home/var"
44 elif errors=$(initlog -c "su -s/bin/sh zope -c \"$instance_home/bin/zopectl $action\"" 2>&1) ; then
46 log_success "$message"
52 [ -n "$errors" ] && [ $exit_code -eq 1 ] && echo "$errors"
59 for INSTANCE_NAME in $INSTANCES
61 INSTANCE_HOME="/var/lib/zope3/$INSTANCE_NAME"
63 if [ -f /var/lock/subsys/"zope3-$INSTANCE_NAME" ]; then
64 msg_already_running "Zope 3 instance $INSTANCE_NAME"
68 zope_ctl "Starting Zope instance $INSTANCE_NAME" "$INSTANCE_HOME" start
70 if [ $RET -eq 0 ]; then
71 touch /var/lock/subsys/"zope3-$INSTANCE_NAME"
81 for INSTANCE_NAME in $INSTANCES
83 INSTANCE_HOME="/var/lib/zope3/$INSTANCE_NAME"
85 if [ ! -f /var/lock/subsys/"zope3-$INSTANCE_NAME" ]; then
86 msg_not_running "Zope 3 instance $INSTANCE_NAME"
90 zope_ctl "Stopping Zope instance $INSTANCE_NAME" "$INSTANCE_HOME" stop
93 if [ $RET -eq 0 ]; then
96 rm -f /var/lock/subsys/"zope3-$INSTANCE_NAME"
103 for INSTANCE_NAME in $INSTANCES
105 INSTANCE_HOME=/var/lib/zope3/"$INSTANCE_NAME"
106 echo -n "$INSTANCE_NAME: "
107 cd "$INSTANCE_HOME/var" && "$INSTANCE_HOME"/bin/zopectl status
111 # See how we were called.
114 msg_starting "Zope 3"
118 if [ "$RETVAL" = 0 ] ; then
119 msg_starting "Zope 3"
121 touch /var/lock/subsys/zope3
123 msg_starting "Zope 3"
128 if [ -f /var/lock/subsys/zope3 ]; then
129 msg_stopping "Zope 3"
133 if [ "$RETVAL" = 0 ] ; then
134 msg_stopping "Zope 3"
137 msg_stopping "Zope 3"
140 rm -f /var/lock/subsys/zope3 >/dev/null 2>&1
142 msg_not_running "Zope 3"
149 restart|force-reload)
155 msg_usage "$0 {start|stop|restart|force-reload|status}"