]>
Commit | Line | Data |
---|---|---|
2e8ebf1a | 1 | #! /bin/sh |
2 | ||
3 | # This is Zope ZServer startscript for PLD Linux | |
4 | # | |
5 | ||
6 | ZOPE_BASE=/usr/lib/zope | |
7 | CLIENT_HOME=$INSTANCE_HOME/var | |
8 | ||
9 | # prepare directories | |
10 | ||
11 | if [ "x$ZOPE_USER" = "x" ]; then | |
12 | ZOPE_USER="zope" | |
13 | fi | |
14 | ||
15 | ZOPE_GROUP=`id -ng $ZOPE_USER` | |
16 | ||
17 | if [ ! -d $INSTANCE_HOME ]; then | |
18 | mkdir $INSTANCE_HOME | |
19 | fi | |
20 | ||
21 | chmod 1701 $INSTANCE_HOME | |
22 | chown root:$ZOPE_GROUP $INSTANCE_HOME | |
23 | ||
24 | if [ ! -d $INSTANCE_HOME/var ]; then | |
25 | mkdir $INSTANCE_HOME/var | |
26 | fi | |
27 | ||
28 | chown root:$ZOPE_GROUP $INSTANCE_HOME/var | |
29 | chmod 1701 $INSTANCE_HOME/var | |
30 | ||
31 | if [ ! -d /var/log/zope ]; then | |
32 | mkdir /var/log/zope | |
33 | chmod o-rwx /var/log/zope | |
34 | chown root:root /var/log/zope | |
35 | fi | |
36 | ||
37 | # prepare parameters | |
38 | ||
39 | if [ "$WATCHDOG" = "0" ]; then | |
40 | manager= | |
41 | else | |
42 | manager="-Z 1" | |
43 | fi | |
44 | ||
45 | if [ "x$CGIBIN_BASE" = "x" ]; then | |
46 | p_string=" " | |
47 | else | |
48 | p_string="-p $CGIBIN_FILE" | |
49 | fi | |
50 | ||
51 | if [ "x$DEBUG_MODE" = "xyes" -o "x$DEBUG_MODE" = "x1" ]; then | |
52 | debugging="-D 1" | |
53 | else | |
54 | debugging= | |
55 | fi | |
56 | ||
57 | if [ "x$LOG_FILE" = "x" -o "x$LOG_FILE" = "x0" ]; then | |
58 | LOG_FILE=/var/log/zope/$INSTANCE_NAME.log | |
59 | fi | |
60 | ||
61 | if [ "x$DETAILED_LOG_FILE" = "x" -o "x$DETAILED_LOG_FILE" = "x0" ]; then | |
62 | details= | |
63 | else | |
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 | |
69 | fi | |
70 | ||
71 | if [ "x$LOC" != "x" ]; then | |
72 | locale="-L $LOC" | |
73 | else | |
74 | locale= | |
75 | fi | |
76 | ||
77 | if [ "x$ICP_PORT" = "x" -o "x$ICP_PORT" = "x0" ]; then | |
78 | icpstr=" " | |
79 | else | |
80 | icpstr="--icp $ICP_PORT" | |
81 | fi | |
82 | ||
83 | if [ "x$IP_ADDRESS" = "x" -o "x$IP_ADDRESS" = "x0" ]; then | |
84 | ipstr=" " | |
85 | else | |
41053b13 | 86 | ipstr="-a '$IP_ADDRESS'" |
2e8ebf1a | 87 | fi |
88 | ||
89 | # show what we're going to do | |
90 | ||
91 | if [ "x$debugging" != "x" ]; then | |
92 | cat <<EE | ( while read line; do echo "zope-start: $line"; done ) >>$LOG_FILE | |
93 | `date` | |
94 | Instance name: $INSTANCE_NAME | |
95 | Executing: | |
96 | exec 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 | |
111 | EE | |
112 | fi | |
113 | ||
114 | # call server | |
115 | ||
116 | exec 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 | & |