]> git.pld-linux.org Git - packages/Zope.git/blame - Zope-start.sh
- post shouldn't depend on environment (use umask, initialize was_stopped)
[packages/Zope.git] / Zope-start.sh
CommitLineData
2e8ebf1a 1#! /bin/sh
2
3# This is Zope ZServer startscript for PLD Linux
4#
5
6ZOPE_BASE=/usr/lib/zope
7CLIENT_HOME=$INSTANCE_HOME/var
8
9# prepare directories
10
11if [ "x$ZOPE_USER" = "x" ]; then
12 ZOPE_USER="zope"
13fi
14
15ZOPE_GROUP=`id -ng $ZOPE_USER`
16
17if [ ! -d $INSTANCE_HOME ]; then
18 mkdir $INSTANCE_HOME
19fi
20
21chmod 1701 $INSTANCE_HOME
22chown root:$ZOPE_GROUP $INSTANCE_HOME
23
24if [ ! -d $INSTANCE_HOME/var ]; then
25 mkdir $INSTANCE_HOME/var
26fi
27
28chown root:$ZOPE_GROUP $INSTANCE_HOME/var
29chmod 1701 $INSTANCE_HOME/var
30
31if [ ! -d /var/log/zope ]; then
32 mkdir /var/log/zope
33 chmod o-rwx /var/log/zope
34 chown root:root /var/log/zope
35fi
36
37# prepare parameters
38
39if [ "$WATCHDOG" = "0" ]; then
40 manager=
41else
42 manager="-Z 1"
43fi
44
45if [ "x$CGIBIN_BASE" = "x" ]; then
46 p_string=" "
47else
48 p_string="-p $CGIBIN_FILE"
49fi
50
51if [ "x$DEBUG_MODE" = "xyes" -o "x$DEBUG_MODE" = "x1" ]; then
52 debugging="-D 1"
53else
54 debugging=
55fi
56
57if [ "x$LOG_FILE" = "x" -o "x$LOG_FILE" = "x0" ]; then
58 LOG_FILE=/var/log/zope/$INSTANCE_NAME.log
59fi
60
61if [ "x$DETAILED_LOG_FILE" = "x" -o "x$DETAILED_LOG_FILE" = "x0" ]; then
62 details=
63else
64 if [ "x$DETAILED_LOG_FILE" = "xyes" -o "x$DETAILED_LOG_FILE" = "x1" ]; then
65 details="-M /var/log/zope/$INSTANCE_NAME-detailed.log"
66 else
67 details="-M $DETAILED_LOG_FILE"
68 fi
69fi
70
71if [ "x$LOC" != "x" ]; then
72 locale="-L $LOC"
73else
74 locale=
75fi
76
77if [ "x$ICP_PORT" = "x" -o "x$ICP_PORT" = "x0" ]; then
78 icpstr=" "
79else
80 icpstr="--icp $ICP_PORT"
81fi
82
83if [ "x$IP_ADDRESS" = "x" -o "x$IP_ADDRESS" = "x0" ]; then
84 ipstr=" "
85else
41053b13 86 ipstr="-a '$IP_ADDRESS'"
2e8ebf1a 87fi
88
89# show what we're going to do
90
91if [ "x$debugging" != "x" ]; then
92cat <<EE | ( while read line; do echo "zope-start: $line"; done ) >>$LOG_FILE
93`date`
94Instance name: $INSTANCE_NAME
95Executing:
96exec python $ZOPE_BASE/z2.py
97 -z $INSTANCE_HOME
98 -t $NUMBER_OF_THREADS
99 -u $ZOPE_USER
100 -w $HTTP_PORT
101 -f $FTP_PORT
102 -l $LOG_FILE
103 $ipstr
104 $icpstr
105 $manager
106 $locale
107 $debugging
108 $p_string
109 $details
110>> $LOG_FILE 2>&1
111EE
112fi
113
114# call server
115
116exec python $ZOPE_BASE/z2.py \
117-z $INSTANCE_HOME \
118-t $NUMBER_OF_THREADS \
119-u $ZOPE_USER \
120-w $HTTP_PORT \
121-f $FTP_PORT \
122-l $LOG_FILE \
123$ipstr \
124$icpstr \
125$manager \
126$locale \
127$debugging \
128$p_string \
129$details \
130>> $LOG_FILE 2>&1 \
131&
This page took 0.052717 seconds and 4 git commands to generate.