Lines 51-56
$scriptname -h|--help
Link Here
|
51 |
--restart Restart the plack daemon for the specified instances |
51 |
--restart Restart the plack daemon for the specified instances |
52 |
--enable Enable plack for the specified instances |
52 |
--enable Enable plack for the specified instances |
53 |
--disable Disable plack for the specified instances |
53 |
--disable Disable plack for the specified instances |
|
|
54 |
--debugger Enable running Plack in debug mode |
55 |
--debugger-key Specify the key the IDE is expecting |
56 |
--debugger-location Specify the host:port for your debugger tool (defaults |
57 |
to localhost:9000) |
58 |
--debugger-path Specify the path for the debugger library |
54 |
--quiet|-q Make the script quiet about non existent instance names |
59 |
--quiet|-q Make the script quiet about non existent instance names |
55 |
(useful for calling from another scripts). |
60 |
(useful for calling from another scripts). |
56 |
--help|-h Display this help message |
61 |
--help|-h Display this help message |
Lines 79-91
start_plack()
Link Here
|
79 |
PLACK_WORKERS=$(run_safe_xmlstarlet $instancename plack_workers) |
84 |
PLACK_WORKERS=$(run_safe_xmlstarlet $instancename plack_workers) |
80 |
[ -z $PLACK_WORKERS ] && PLACK_WORKERS="2" |
85 |
[ -z $PLACK_WORKERS ] && PLACK_WORKERS="2" |
81 |
|
86 |
|
82 |
STARMANOPTS="-M FindBin --max-requests ${PLACK_MAX_REQUESTS} --workers ${PLACK_WORKERS} \ |
87 |
environment="deployment" |
|
|
88 |
daemonize="--daemonize" |
89 |
logging="--access-log /var/log/koha/${instancename}/plack.log \ |
90 |
--error-log /var/log/koha/${instancename}/plack-error.log" |
91 |
max_requests_and_workers="--max-requests ${PLACK_MAX_REQUESTS} --workers ${PLACK_WORKERS}" |
92 |
|
93 |
if [ "$debug_mode" = "yes" ]; then |
94 |
environment="development" |
95 |
daemonize="" |
96 |
logging="" # remote debugger takes care |
97 |
max_requests_and_workers="--workers 1" |
98 |
fi |
99 |
|
100 |
STARMANOPTS="-M FindBin ${max_requests_and_workers} \ |
83 |
--user=${instancename}-koha --group ${instancename}-koha \ |
101 |
--user=${instancename}-koha --group ${instancename}-koha \ |
84 |
--pid ${PIDFILE} \ |
102 |
--pid ${PIDFILE} ${daemonize} ${logging} \ |
85 |
--daemonize \ |
103 |
-E ${environment} --socket ${PLACKSOCKET} ${PSGIFILE}" |
86 |
--access-log /var/log/koha/${instancename}/plack.log \ |
|
|
87 |
--error-log /var/log/koha/${instancename}/plack-error.log \ |
88 |
-E deployment --socket ${PLACKSOCKET} ${PSGIFILE}" |
89 |
|
104 |
|
90 |
if ! is_plack_running ${instancename}; then |
105 |
if ! is_plack_running ${instancename}; then |
91 |
export KOHA_CONF="/etc/koha/sites/${instancename}/koha-conf.xml" |
106 |
export KOHA_CONF="/etc/koha/sites/${instancename}/koha-conf.xml" |
Lines 239-244
set_action()
Link Here
|
239 |
STARMAN=$(which starman) |
254 |
STARMAN=$(which starman) |
240 |
op="" |
255 |
op="" |
241 |
quiet="no" |
256 |
quiet="no" |
|
|
257 |
debug_mode="no" |
258 |
debugger_key="" |
259 |
debugger_location="localhost:9000" |
260 |
debugger_path="" |
242 |
|
261 |
|
243 |
# Read command line parameters |
262 |
# Read command line parameters |
244 |
while [ $# -gt 0 ]; do |
263 |
while [ $# -gt 0 ]; do |
Lines 264-269
while [ $# -gt 0 ]; do
Link Here
|
264 |
--disable) |
283 |
--disable) |
265 |
set_action "disable" |
284 |
set_action "disable" |
266 |
shift ;; |
285 |
shift ;; |
|
|
286 |
--debugger) |
287 |
debug_mode="yes" |
288 |
shift ;; |
289 |
--debugger-key) |
290 |
debugger_key="$2" |
291 |
shift 2 ;; |
292 |
--debugger-location) |
293 |
debugger_location="$2" |
294 |
shift 2 ;; |
295 |
--debugger-path) |
296 |
debugger_path="$2" |
297 |
shift 2 ;; |
267 |
-*) |
298 |
-*) |
268 |
die "Error: invalid option switch ($1)" ;; |
299 |
die "Error: invalid option switch ($1)" ;; |
269 |
*) |
300 |
*) |
Lines 282-288
if [ $# -gt 0 ]; then
Link Here
|
282 |
if is_instance $name; then |
313 |
if is_instance $name; then |
283 |
|
314 |
|
284 |
adjust_paths_dev_install $name |
315 |
adjust_paths_dev_install $name |
285 |
export DEV_INSTALL KOHA_HOME PERL5LIB=$PERL5LIB:$KOHA_HOME/installer:$KOHA_HOME/lib/installer |
316 |
export DEV_INSTALL |
|
|
317 |
export KOHA_HOME |
318 |
PERL5LIB=$PERL5LIB:$KOHA_HOME/installer:$KOHA_HOME/lib/installer |
319 |
# If debug mode is enabled, add the debugger lib path |
320 |
# to PERL5LIB if appropriate |
321 |
if [ "$debug_mode" = "yes" ]; then |
322 |
if [ "$debugger_path" != "" ]; then |
323 |
PERL5LIB="${debugger_path}":$PERL5LIB |
324 |
fi |
325 |
export PERL5DB="BEGIN { require q(${debugger_path}/perl5db.pl) }" |
326 |
export PERLDB_OPTS="RemotePort=${debugger_location}" |
327 |
export DBGP_IDEKEY=${debugger_key} |
328 |
export PLACK_DEBUG=1 |
329 |
export PERL5OPT="-d" |
330 |
fi |
331 |
|
332 |
export PERL5LIB |
286 |
|
333 |
|
287 |
case $op in |
334 |
case $op in |
288 |
"start") |
335 |
"start") |
289 |
- |
|
|