1 |
patrick 12/03/22 00:39:54 |
2 |
|
3 |
Added: gatling.initd-2 |
4 |
Removed: gentoo-vars.patch |
5 |
Log: |
6 |
Init script fixes for #409245 |
7 |
|
8 |
(Portage version: 2.2.0_alpha93/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 www-servers/gatling/files/gatling.initd-2 |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/gatling/files/gatling.initd-2?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/gatling/files/gatling.initd-2?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: gatling.initd-2 |
17 |
=================================================================== |
18 |
#!/sbin/runscript |
19 |
# Copyright 1999-2012 Gentoo Foundation |
20 |
# Distributed under the terms of the GNU General Public License v2 |
21 |
|
22 |
description="Gatling high performance web server init script" |
23 |
extra_started_commands="reload" |
24 |
|
25 |
depend() { |
26 |
need net |
27 |
} |
28 |
|
29 |
checkconfig() { |
30 |
# Verify UID is valid for running process. |
31 |
if [[ ! $(id ${GATLING_UID} 2>/dev/null) ]]; then |
32 |
ewarn "User ${GATLING_UID} not found!" |
33 |
return 1 |
34 |
fi |
35 |
|
36 |
# Set gatling run opts |
37 |
if yesno ${VHOST};then VHOST=-v;else VHOST=-V;fi |
38 |
if yesno ${SSL};then SSL=-e;else SSL=-E;fi |
39 |
if yesno ${DIR_INDEXING};then DIR_INDEXING=-d;else DIR_INDEXING=-D;fi |
40 |
if yesno ${FTP}; then FTP=-f;else FTP=-F;fi |
41 |
if yesno ${FTP_AUTH}; then FTP_AUTH=-l;else unset FTP_AUTH;fi |
42 |
if yesno ${FTP_UP};then unset FTP_UP;else FTP_UP=-U;fi |
43 |
if yesno ${TRANS_PROXY};then TRANS_PROXY=-t;else unset TRANS_PROXY;fi |
44 |
} |
45 |
|
46 |
start() { |
47 |
checkconfig || return 1 |
48 |
|
49 |
ebegin "Starting gatling" |
50 |
start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \ |
51 |
--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \ |
52 |
${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \ |
53 |
${FTP_AUTH} ${FTP_UPLOADS} |
54 |
eend $? |
55 |
} |
56 |
|
57 |
stop() { |
58 |
ebegin "Stopping gatling" |
59 |
start-stop-daemon --quiet --stop --pidfile ${PID} |
60 |
eend $? |
61 |
} |
62 |
|
63 |
reload() { |
64 |
if ! service_started "${SVCNAME}" ; then |
65 |
eerror "${SVCNAME} isn't running" |
66 |
return 1 |
67 |
fi |
68 |
|
69 |
checkconfig || return 1 |
70 |
|
71 |
ebegin "Sending gatling the HUP signal" |
72 |
start-stop-daemon --quiet --signal HUP --pidfile ${PID} |
73 |
|
74 |
ebegin "Restarting gatling server" |
75 |
start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \ |
76 |
--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \ |
77 |
${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \ |
78 |
${FTP_AUTH} ${FTP_UPLOADS} |
79 |
eend $? |
80 |
} |