View | Details | Raw Unified | Return to bug 79197
Collapse All | Expand All

(-)./Makefile (-5 / +7 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	cocoon
8
PORTNAME=	cocoon
9
PORTVERSION=	2.1.6
9
PORTVERSION=	2.1.7
10
CATEGORIES=	www java
10
CATEGORIES=	www java
11
MASTER_SITES=	${MASTER_SITE_APACHE:S,%SUBDIR%,${PORTNAME},}
11
MASTER_SITES=	${MASTER_SITE_APACHE:S,%SUBDIR%,${PORTNAME},}
12
DISTNAME=	${PDISTNAME}-src
12
DISTNAME=	${PDISTNAME}-src
Lines 35-46 Link Here
35
COPYDIRS=	*.txt tools/jetty tools/loader legal webapp
35
COPYDIRS=	*.txt tools/jetty tools/loader legal webapp
36
36
37
PORT?=		8888
37
PORT?=		8888
38
PID_FILE?=	/var/run/${APP_NAME}.pid
38
PID_FILE?=	${APP_HOME}/${APP_NAME}.pid
39
RUNASUSER?=	www
39
RUNASUSER?=	www
40
RUNASUID?=	80
40
RUNASUID?=	80
41
GROUP?=		www
41
GROUP?=		www
42
GID?=		80
42
GID?=		80
43
LOGFILE?=	/var/log/${APP_NAME}.log
43
LOG_FILE?=	${APP_HOME}/${APP_NAME}.log
44
44
45
SUBSTITUTIONS=	\
45
SUBSTITUTIONS=	\
46
	-e "s|%%APP_HOME%%|${APP_HOME}|g" \
46
	-e "s|%%APP_HOME%%|${APP_HOME}|g" \
Lines 49-60 Link Here
49
	-e "s|%%PORT%%|${PORT}|g" \
49
	-e "s|%%PORT%%|${PORT}|g" \
50
	-e "s|%%COCOON_LIB%%|${COCOON_LIB}|g" \
50
	-e "s|%%COCOON_LIB%%|${COCOON_LIB}|g" \
51
	-e "s|%%JAVA_HOME%%|${JAVA_HOME}|g" \
51
	-e "s|%%JAVA_HOME%%|${JAVA_HOME}|g" \
52
	-e "s|%%JAVA%%|${JAVA}|g" \
52
	-e "s|%%PID_FILE%%|${PID_FILE}|g" \
53
	-e "s|%%PID_FILE%%|${PID_FILE}|g" \
53
	-e "s|%%RUNASUSER%%|${RUNASUSER}|g" \
54
	-e "s|%%RUNASUSER%%|${RUNASUSER}|g" \
54
	-e "s|%%RUNASUID%%|${RUNASUID}|g" \
55
	-e "s|%%RUNASUID%%|${RUNASUID}|g" \
55
	-e "s|%%GROUP%%|${GROUP}|g" \
56
	-e "s|%%GROUP%%|${GROUP}|g" \
56
	-e "s|%%GID%%|${GID}|g" \
57
	-e "s|%%GID%%|${GID}|g" \
57
	-e "s|%%LOGFILE%%|${LOGFILE}|g" \
58
	-e "s|%%LOG_FILE%%|${LOG_FILE}|g" \
58
	-e "s|%%PYTHON_CMD%%|${PYTHON_CMD}|g"
59
	-e "s|%%PYTHON_CMD%%|${PYTHON_CMD}|g"
59
60
60
# Load options (before including bsd.port.pre.mk)
61
# Load options (before including bsd.port.pre.mk)
Lines 102-110 Link Here
102
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./build.sh
103
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./build.sh
103
104
104
post-build:
105
post-build:
105
	${LN} -s ${WRKSRC}/build/webapp ${WRKSRC}/webapp
106
	${TEST} -h ${WRKSRC}/webapp || ${LN} -s ${WRKSRC}/build/webapp ${WRKSRC}/webapp
106
107
107
	@${ECHO_MSG} "===> Building packing list"
108
	@${ECHO_MSG} "===> Building packing list"
109
	@> ${PLIST}
108
110
109
	@cd ${WRKSRC} && ${FIND} -H ${COPYDIRS} -type f \
111
	@cd ${WRKSRC} && ${FIND} -H ${COPYDIRS} -type f \
110
	| ${SED} -e "s|^|${APP_NAME}/|" >> ${PLIST}
112
	| ${SED} -e "s|^|${APP_NAME}/|" >> ${PLIST}
(-)./Makefile.options (-6 / +6 lines)
Lines 18-23 Link Here
18
OPTIONS+=	LINKREWRITER	'Enable the linkrewriter block'	on
18
OPTIONS+=	LINKREWRITER	'Enable the linkrewriter block'	on
19
OPTIONS+=	LUCENE	'Enable the lucene block'	on
19
OPTIONS+=	LUCENE	'Enable the lucene block'	on
20
OPTIONS+=	NAMING	'Enable the naming block'	on
20
OPTIONS+=	NAMING	'Enable the naming block'	on
21
OPTIONS+=	OJB	'Enable the ojb block'	on
21
OPTIONS+=	PARANOID	'Enable the paranoid block'	on
22
OPTIONS+=	PARANOID	'Enable the paranoid block'	on
22
OPTIONS+=	POI	'Enable the poi block'	on
23
OPTIONS+=	POI	'Enable the poi block'	on
23
OPTIONS+=	PORTAL	'Enable the portal block'	off
24
OPTIONS+=	PORTAL	'Enable the portal block'	off
Lines 28-33 Link Here
28
OPTIONS+=	WEB3	'Enable the web3 block'	on
29
OPTIONS+=	WEB3	'Enable the web3 block'	on
29
OPTIONS+=	XMLDB	'Enable the xmldb block'	on
30
OPTIONS+=	XMLDB	'Enable the xmldb block'	on
30
OPTIONS+=	XSP	'Enable the xsp block'	on
31
OPTIONS+=	XSP	'Enable the xsp block'	on
32
OPTIONS+=	PHP	'Enable the php block'	off
33
OPTIONS+=	PORTAL_FW	'Enable the portal-fw block'	off
34
OPTIONS+=	SWF	'Enable the swf block'	off
35
OPTIONS+=	WOODY	'Enable the woody block'	off
31
OPTIONS+=	APPLES	'Enable the apples block'	on
36
OPTIONS+=	APPLES	'Enable the apples block'	on
32
OPTIONS+=	ASCIIART	'Enable the asciiart block'	on
37
OPTIONS+=	ASCIIART	'Enable the asciiart block'	on
33
OPTIONS+=	AXIS	'Enable the axis block'	on
38
OPTIONS+=	AXIS	'Enable the axis block'	on
Lines 41-52 Link Here
41
OPTIONS+=	LINOTYPE	'Enable the linotype block'	on
46
OPTIONS+=	LINOTYPE	'Enable the linotype block'	on
42
OPTIONS+=	MAIL	'Enable the mail block'	on
47
OPTIONS+=	MAIL	'Enable the mail block'	on
43
OPTIONS+=	MIDI	'Enable the midi block'	on
48
OPTIONS+=	MIDI	'Enable the midi block'	on
44
OPTIONS+=	OJB	'Enable the ojb block'	on
45
OPTIONS+=	PETSTORE	'Enable the petstore block'	on
49
OPTIONS+=	PETSTORE	'Enable the petstore block'	on
46
OPTIONS+=	PROXY	'Enable the proxy block'	on
50
OPTIONS+=	PROXY	'Enable the proxy block'	on
47
OPTIONS+=	QDOX	'Enable the qdox block'	on
51
OPTIONS+=	QDOX	'Enable the qdox block'	on
52
OPTIONS+=	QUERYBEAN	'Enable the querybean block'	on
48
OPTIONS+=	REPOSITORY	'Enable the repository block'	on
53
OPTIONS+=	REPOSITORY	'Enable the repository block'	on
49
OPTIONS+=	SCRATCHPAD	'Enable the scratchpad block'	on
50
OPTIONS+=	SERIALIZERS	'Enable the serializers block'	on
54
OPTIONS+=	SERIALIZERS	'Enable the serializers block'	on
51
OPTIONS+=	SLIDE	'Enable the slide block'	on
55
OPTIONS+=	SLIDE	'Enable the slide block'	on
52
OPTIONS+=	SLOP	'Enable the slop block'	on
56
OPTIONS+=	SLOP	'Enable the slop block'	on
Lines 54-60 Link Here
54
OPTIONS+=	TAGLIB	'Enable the taglib block'	on
58
OPTIONS+=	TAGLIB	'Enable the taglib block'	on
55
OPTIONS+=	TOUR	'Enable the tour block'	on
59
OPTIONS+=	TOUR	'Enable the tour block'	on
56
OPTIONS+=	WEBDAV	'Enable the webdav block'	on
60
OPTIONS+=	WEBDAV	'Enable the webdav block'	on
57
OPTIONS+=	PHP	'Enable the php block'	off
58
OPTIONS+=	PORTAL_FW	'Enable the portal-fw block'	off
59
OPTIONS+=	SWF	'Enable the swf block'	off
60
OPTIONS+=	WOODY	'Enable the woody block'	off
(-)./Makefile.test-options (-46 / +39 lines)
Lines 14-20 Link Here
14
14
15
.if defined(WITH_CHAPERON)
15
.if defined(WITH_CHAPERON)
16
BLOCKS+=	chaperon
16
BLOCKS+=	chaperon
17
BLOCKS+=	xsp
18
.endif
17
.endif
19
18
20
.if defined(WITH_DATABASES)
19
.if defined(WITH_DATABASES)
Lines 56-69 Link Here
56
55
57
.if defined(WITH_LUCENE)
56
.if defined(WITH_LUCENE)
58
BLOCKS+=	lucene
57
BLOCKS+=	lucene
59
BLOCKS+=	forms
60
BLOCKS+=	xsp
61
.endif
58
.endif
62
59
63
.if defined(WITH_NAMING)
60
.if defined(WITH_NAMING)
64
BLOCKS+=	naming
61
BLOCKS+=	naming
65
.endif
62
.endif
66
63
64
.if defined(WITH_OJB)
65
BLOCKS+=	ojb
66
BLOCKS+=	databases
67
BLOCKS+=	forms
68
BLOCKS+=	hsqldb
69
BLOCKS+=	xsp
70
.endif
71
67
.if defined(WITH_PARANOID)
72
.if defined(WITH_PARANOID)
68
BLOCKS+=	paranoid
73
BLOCKS+=	paranoid
69
.endif
74
.endif
Lines 75-81 Link Here
75
.if defined(WITH_PORTAL)
80
.if defined(WITH_PORTAL)
76
BLOCKS+=	portal
81
BLOCKS+=	portal
77
BLOCKS+=	authentication-fw
82
BLOCKS+=	authentication-fw
78
BLOCKS+=	html
83
BLOCKS+=	cron
84
BLOCKS+=	forms
79
BLOCKS+=	session-fw
85
BLOCKS+=	session-fw
80
BLOCKS+=	xsp
86
BLOCKS+=	xsp
81
.endif
87
.endif
Lines 112-121 Link Here
112
BLOCKS+=	xsp
118
BLOCKS+=	xsp
113
.endif
119
.endif
114
120
121
.if defined(WITH_PHP)
122
BLOCKS+=	php
123
.endif
124
125
.if defined(WITH_PORTAL_FW)
126
BLOCKS+=	portal-fw
127
BLOCKS+=	authentication-fw
128
BLOCKS+=	session-fw
129
BLOCKS+=	xsp
130
.endif
131
132
.if defined(WITH_SWF)
133
BLOCKS+=	swf
134
.endif
135
136
.if defined(WITH_WOODY)
137
BLOCKS+=	woody
138
BLOCKS+=	xsp
139
.endif
140
115
.if defined(WITH_APPLES)
141
.if defined(WITH_APPLES)
116
BLOCKS+=	apples
142
BLOCKS+=	apples
117
BLOCKS+=	forms
143
BLOCKS+=	forms
118
BLOCKS+=	xsp
119
.endif
144
.endif
120
145
121
.if defined(WITH_ASCIIART)
146
.if defined(WITH_ASCIIART)
Lines 145-151 Link Here
145
.if defined(WITH_FACES)
170
.if defined(WITH_FACES)
146
BLOCKS+=	faces
171
BLOCKS+=	faces
147
BLOCKS+=	authentication-fw
172
BLOCKS+=	authentication-fw
148
BLOCKS+=	html
173
BLOCKS+=	cron
174
BLOCKS+=	forms
149
BLOCKS+=	portal
175
BLOCKS+=	portal
150
BLOCKS+=	session-fw
176
BLOCKS+=	session-fw
151
BLOCKS+=	taglib
177
BLOCKS+=	taglib
Lines 154-160 Link Here
154
180
155
.if defined(WITH_FORMS)
181
.if defined(WITH_FORMS)
156
BLOCKS+=	forms
182
BLOCKS+=	forms
157
BLOCKS+=	xsp
158
.endif
183
.endif
159
184
160
.if defined(WITH_JAVAFLOW)
185
.if defined(WITH_JAVAFLOW)
Lines 186-199 Link Here
186
BLOCKS+=	midi
211
BLOCKS+=	midi
187
.endif
212
.endif
188
213
189
.if defined(WITH_OJB)
190
BLOCKS+=	ojb
191
BLOCKS+=	databases
192
BLOCKS+=	forms
193
BLOCKS+=	hsqldb
194
BLOCKS+=	xsp
195
.endif
196
197
.if defined(WITH_PETSTORE)
214
.if defined(WITH_PETSTORE)
198
BLOCKS+=	petstore
215
BLOCKS+=	petstore
199
BLOCKS+=	databases
216
BLOCKS+=	databases
Lines 211-235 Link Here
211
BLOCKS+=	qdox
228
BLOCKS+=	qdox
212
.endif
229
.endif
213
230
214
.if defined(WITH_REPOSITORY)
231
.if defined(WITH_QUERYBEAN)
215
BLOCKS+=	repository
232
BLOCKS+=	querybean
216
BLOCKS+=	databases
233
BLOCKS+=	databases
217
BLOCKS+=	eventcache
234
BLOCKS+=	forms
218
BLOCKS+=	hsqldb
235
BLOCKS+=	hsqldb
219
BLOCKS+=	jms
236
BLOCKS+=	lucene
237
BLOCKS+=	ojb
220
BLOCKS+=	xsp
238
BLOCKS+=	xsp
221
.endif
239
.endif
222
240
223
.if defined(WITH_SCRATCHPAD)
241
.if defined(WITH_REPOSITORY)
224
BLOCKS+=	scratchpad
242
BLOCKS+=	repository
225
BLOCKS+=	axis
226
BLOCKS+=	batik
227
BLOCKS+=	cron
228
BLOCKS+=	databases
243
BLOCKS+=	databases
229
BLOCKS+=	eventcache
244
BLOCKS+=	eventcache
230
BLOCKS+=	hsqldb
245
BLOCKS+=	hsqldb
231
BLOCKS+=	jms
246
BLOCKS+=	jms
232
BLOCKS+=	repository
233
BLOCKS+=	xsp
247
BLOCKS+=	xsp
234
.endif
248
.endif
235
249
Lines 264-270 Link Here
264
BLOCKS+=	batik
278
BLOCKS+=	batik
265
BLOCKS+=	fop
279
BLOCKS+=	fop
266
BLOCKS+=	forms
280
BLOCKS+=	forms
267
BLOCKS+=	xsp
268
.endif
281
.endif
269
282
270
.if defined(WITH_WEBDAV)
283
.if defined(WITH_WEBDAV)
Lines 274-299 Link Here
274
BLOCKS+=	hsqldb
287
BLOCKS+=	hsqldb
275
BLOCKS+=	jms
288
BLOCKS+=	jms
276
BLOCKS+=	repository
289
BLOCKS+=	repository
277
BLOCKS+=	xsp
278
.endif
279
280
.if defined(WITH_PHP)
281
BLOCKS+=	php
282
.endif
283
284
.if defined(WITH_PORTAL_FW)
285
BLOCKS+=	portal-fw
286
BLOCKS+=	authentication-fw
287
BLOCKS+=	session-fw
288
BLOCKS+=	xsp
289
.endif
290
291
.if defined(WITH_SWF)
292
BLOCKS+=	swf
293
.endif
294
295
.if defined(WITH_WOODY)
296
BLOCKS+=	woody
297
BLOCKS+=	xsp
290
BLOCKS+=	xsp
298
.endif
291
.endif
299
292
(-)./distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
MD5 (cocoon-2.1.6-src.tar.gz) = d7a3a5b2c89452df95f85eeb031bbbae
1
MD5 (cocoon-2.1.7-src.tar.gz) = 423209dad3650e4f4fb1d76bd64a4747
2
SIZE (cocoon-2.1.6-src.tar.gz) = 44430985
2
SIZE (cocoon-2.1.7-src.tar.gz) = 41950734
(-)./files/cocoon.sh (-1 / +1 lines)
Lines 19-25 Link Here
19
command=%%PREFIX%%/sbin/%%APP_NAME%%ctl
19
command=%%PREFIX%%/sbin/%%APP_NAME%%ctl
20
command_args="$1"
20
command_args="$1"
21
pidfile=%%PID_FILE%%
21
pidfile=%%PID_FILE%%
22
procname=java
22
procname=%%JAVA%%
23
23
24
# set defaults
24
# set defaults
25
25
(-)./files/cocoonctl (-31 / +145 lines)
Lines 6-48 Link Here
6
# Date Created:  2004-05-04 11:14:05
6
# Date Created:  2004-05-04 11:14:05
7
# Revision:      $FreeBSD: ports/www/cocoon/files/cocoonctl,v 1.1 2004/07/01 22:30:19 glewis Exp $
7
# Revision:      $FreeBSD: ports/www/cocoon/files/cocoonctl,v 1.1 2004/07/01 22:30:19 glewis Exp $
8
################################################################################
8
################################################################################
9
# Copyright (c) 2004, Jean-Baptiste Quenot <jb.quenot@caraldi.com>
10
# All rights reserved.
11
#
12
# Redistribution and use in source and binary forms, with or without
13
# modification, are permitted provided that the following conditions are met:
14
#
15
# * Redistributions of source code must retain the above copyright notice, this
16
#   list of conditions and the following disclaimer.
17
# * Redistributions in binary form must reproduce the above copyright notice,
18
#   this list of conditions and the following disclaimer in the documentation
19
#   and/or other materials provided with the distribution.
20
# * The name of the contributors may not be used to endorse or promote products
21
#   derived from this software without specific prior written permission.
22
#
23
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
27
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
################################################################################
34
#
35
# Files handled by this script (pid file, log files) must reside in a writable
36
# directory, ie the directory must be owned by the user running the program.
37
38
import sys, os, signal, time, stat, re
39
40
def readProcessId():
41
    f = open(PID_FILE, 'r')
42
    pid = int(f.readline())
43
    f.close()
44
    return pid
45
46
def isProgramRunning(pid):
47
    # Send a dummy signal to the process.  If it died, an exception is
48
    # thrown
49
    try:
50
        os.kill(pid, signal.SIGCONT)
51
        return 1
52
    except OSError:
53
        return 0
54
55
def usage():
56
    print >> sys.stderr, "Usage: %s {start|stop|restart}" % sys.argv[0]
57
58
def start():
59
    cwd = os.getcwd()
60
    if os.path.exists(PID_FILE):
61
        # Read the process id
62
        pid = readProcessId()
9
63
10
import sys, os, signal, time
64
        if isProgramRunning(pid):
65
            print >> sys.stderr, '%s already started' % APP_NAME
66
            sys.exit(3)
67
68
    if not(os.path.exists(COMMAND)):
69
        print >> sys.stderr, '%s cannot be found' % COMMAND
70
        sys.exit(3)
71
72
    # Append program output to a log file
73
    l = open(LOG_FILE, 'a')
74
    orig_stderr = os.dup(sys.stderr.fileno())
75
    os.dup2(l.fileno(), sys.stdout.fileno())
76
    os.dup2(l.fileno(), sys.stderr.fileno())
77
78
    finfo = os.stat(COMMAND)[stat.ST_MODE]
79
    executable = stat.S_IMODE(finfo) & 0111
80
    if not(executable):
81
        sys.stderr = os.fdopen(orig_stderr, 'w')
82
        print >> sys.stderr, 'Cannot run %s, execute bit is missing' % COMMAND
83
        sys.exit(5)
84
85
    if APP_HOME:
86
        # Change current directory to APP_HOME
87
        os.chdir(APP_HOME)
88
89
    # Start program in the background
90
    pid = os.spawnv(os.P_NOWAIT, COMMAND, ARGS)
91
92
    # Wait a little
93
    time.sleep(.4)
94
    (status_pid, status) = os.waitpid(pid, os.WNOHANG)
95
96
    # Check program exit status, if available
97
    if status_pid != 0 and os.WIFEXITED(status):
98
        sys.stderr = os.fdopen(orig_stderr, 'w')
99
        print >> sys.stderr, 'Could not start %s.  Check %s for errors.' % (APP_NAME, LOG_FILE)
100
        sys.exit(2)
101
102
    # It's alive, so write down the process id
103
    os.chdir(cwd)
104
    f = open(PID_FILE, 'w')
105
    print >> f, pid
106
    f.close()
107
108
def warnNotRunning():
109
    if sys.argv[1] == "stop":
110
        print >> sys.stderr, '%s is not running' % APP_NAME
111
    else:
112
        print >> sys.stderr, 'Warning: %s was not running' % APP_NAME
11
113
12
LOGFILE = "%%LOGFILE%%"
114
def cleanup():
13
PREFIX = "%%PREFIX%%"
115
    os.unlink(PID_FILE)
14
APP_NAME = "%%APP_NAME%%"
15
PID_FILE = "%%PID_FILE%%"
16
116
17
if __name__ == '__main__':
117
def stop():
18
    if sys.argv[1] == "start":
118
    if os.path.exists(PID_FILE):
19
        # Append cocoon output to a log file
119
        # Read the process id
20
        l = open(LOGFILE, 'a')
120
        pid = readProcessId()
21
        os.dup2(l.fileno(), sys.stdout.fileno())
121
    else:
22
        os.dup2(l.fileno(), sys.stderr.fileno())
122
        warnNotRunning()
23
123
        return
24
        # Start cocoon in the background
25
        command = PREFIX + "/sbin/" + APP_NAME + ".sh"
26
        pid = os.spawnl(os.P_NOWAIT, command, command, "servlet")
27
124
28
        # Wait a little
125
    if not(isProgramRunning(pid)):
29
        time.sleep(0.4)
126
        warnNotRunning()
127
        cleanup()
128
        return
30
129
31
        # Send a dummy signal to the process.  If it died, an exception is
130
    # Terminate program
32
        # thrown
131
    os.kill(pid, signal.SIGTERM)
33
        os.kill(pid, signal.SIGCONT)
132
133
    while isProgramRunning(pid):
134
        time.sleep(.1)
135
136
    cleanup()
137
138
if __name__ == '__main__':
139
    LOG_FILE = "%%LOG_FILE%%"
140
    APP_NAME = "%%APP_NAME%%"
141
    APP_HOME = "%%APP_HOME%%"
142
    PID_FILE = "%%PID_FILE%%"
143
    COMMAND = "%%PREFIX%%/sbin/%%APP_NAME%%.sh"
144
    ARGS = [COMMAND, "servlet"]
145
146
    if len(sys.argv) != 2:
147
        usage()
148
        sys.exit(1)
149
150
    if sys.argv[1] == "start":
151
        start()
34
152
35
        # It's alive, so write down the process id
36
        f = open(PID_FILE, 'w')
37
        print >> f, pid
38
        f.close()
39
    elif sys.argv[1] == "stop":
153
    elif sys.argv[1] == "stop":
40
        # Read the process id
154
        stop()
41
        f = open(PID_FILE, 'r')
155
42
        pid = int(f.readline())
156
    elif sys.argv[1] == "restart":
43
        f.close()
157
        stop()
158
        start()
44
159
45
        # Terminate cocoon
46
        os.kill(pid, signal.SIGTERM)
47
    else:
160
    else:
48
        print "Usage: %s start|stop" % sys.argv[0]
161
        usage()
162
        sys.exit(1)
(-)./files/pkg-deinstall (-3 / +3 lines)
Lines 18-24 Link Here
18
PID_FILE=%%PID_FILE%%
18
PID_FILE=%%PID_FILE%%
19
RUNASUSER=%%RUNASUSER%%
19
RUNASUSER=%%RUNASUSER%%
20
APP_NAME=%%APP_NAME%%
20
APP_NAME=%%APP_NAME%%
21
LOGFILE=%%LOGFILE%%
21
LOG_FILE=%%LOG_FILE%%
22
22
23
# Make sure we're in the right stage of the process
23
# Make sure we're in the right stage of the process
24
if [ "$2" = "DEINSTALL" ]; then
24
if [ "$2" = "DEINSTALL" ]; then
Lines 43-50 Link Here
43
        fi
43
        fi
44
    fi
44
    fi
45
45
46
    echo -n ">> Removing log file (${LOGFILE})..."
46
    echo -n ">> Removing log file (${LOG_FILE})..."
47
    if rm ${LOGFILE} > /dev/null 2> /dev/null ; then
47
    if rm ${LOG_FILE} > /dev/null 2> /dev/null ; then
48
        echo " [ DONE ]"
48
        echo " [ DONE ]"
49
    else
49
    else
50
        echo " [ FAILED ]"
50
        echo " [ FAILED ]"
(-)./files/pkg-install (-3 / +1 lines)
Lines 16-22 Link Here
16
GID=%%GID%%
16
GID=%%GID%%
17
APP_NAME=%%APP_NAME%%
17
APP_NAME=%%APP_NAME%%
18
PID_FILE=%%PID_FILE%%
18
PID_FILE=%%PID_FILE%%
19
LOGFILE=%%LOGFILE%%
19
LOG_FILE=%%LOG_FILE%%
20
20
21
if [ "$2" = "POST-INSTALL" ]; then
21
if [ "$2" = "POST-INSTALL" ]; then
22
    # We're called after the 'make install' process
22
    # We're called after the 'make install' process
Lines 48-55 Link Here
48
    fi
48
    fi
49
49
50
    chown -R ${RUNASUSER}:${GROUP} $PKG_PREFIX/${APP_NAME}
50
    chown -R ${RUNASUSER}:${GROUP} $PKG_PREFIX/${APP_NAME}
51
    touch ${LOGFILE} ${PID_FILE}
52
    chown ${RUNASUSER}:${GROUP} ${LOGFILE} ${PID_FILE}
53
fi
51
fi
54
52
55
exit 0
53
exit 0

Return to bug 79197