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

(-)a/debian/scripts/koha-plack (-42 / +49 lines)
Lines 328-333 set_action() Link Here
328
    fi
328
    fi
329
}
329
}
330
330
331
_do_instance() {
332
    local name=$1
333
    local PERL5LIB=$PERL5LIB
334
    local KOHA_HOME=$KOHA_HOME
335
    local DEV_INSTALL=$DEV_INSTALL
336
337
    adjust_paths_dev_install $name
338
    PERL5LIB=$PERL5LIB:$KOHA_HOME/installer:$KOHA_HOME/lib/installer
339
    # If debug mode is enabled, add the debugger lib path
340
    # to PERL5LIB if appropriate
341
    #FIXME: many of these variables should be set in a higher scope
342
    if [ "$debug_mode" = "yes" ]; then
343
        if [ "$debugger_path" != "" ]; then
344
            PERL5LIB="${debugger_path}":$PERL5LIB
345
        fi
346
        export PERL5DB="BEGIN { require q(${debugger_path}/perl5db.pl) }"
347
        export PERLDB_OPTS="RemotePort=${debugger_location} async=1 LogFile=/var/log/koha/${name}/plack-debug.log"
348
        export DBGP_IDEKEY=${debugger_key}
349
        export PLACK_DEBUG=1
350
        export PERL5OPT="-d"
351
    fi
352
353
    case $op in
354
        "start")
355
            start_plack $name
356
            ;;
357
        "stop")
358
            stop_plack $name
359
            ;;
360
        "restart")
361
            restart_plack $name
362
            ;;
363
        "enable")
364
            enable_plack $name
365
            ;;
366
        "disable")
367
            disable_plack $name
368
            ;;
369
        *)
370
            usage
371
            ;;
372
    esac
373
}
374
331
STARMAN=$(which starman)
375
STARMAN=$(which starman)
332
op=""
376
op=""
333
quiet="no"
377
quiet="no"
Lines 383-434 done Link Here
383
427
384
[ "${quiet}" != "yes" ] && check_env_and_warn
428
[ "${quiet}" != "yes" ] && check_env_and_warn
385
429
430
export PERL5LIB
431
export DEV_INSTALL
432
export KOHA_HOME
433
386
if [ $# -gt 0 ]; then
434
if [ $# -gt 0 ]; then
387
    # We have at least one instance name
435
    # We have at least one instance name
388
    for name in "$@"; do
436
    for name in "$@"; do
389
437
390
        if is_instance $name; then
438
        if is_instance $name; then
391
439
            _do_instance $name
392
            adjust_paths_dev_install $name
393
            export DEV_INSTALL
394
            export KOHA_HOME
395
            PERL5LIB=$PERL5LIB:$KOHA_HOME/installer:$KOHA_HOME/lib/installer
396
            # If debug mode is enabled, add the debugger lib path
397
            # to PERL5LIB if appropriate
398
            if [ "$debug_mode" = "yes" ]; then
399
                if [ "$debugger_path" != "" ]; then
400
                    PERL5LIB="${debugger_path}":$PERL5LIB
401
                fi
402
                export PERL5DB="BEGIN { require q(${debugger_path}/perl5db.pl) }"
403
                export PERLDB_OPTS="RemotePort=${debugger_location} async=1 LogFile=/var/log/koha/${name}/plack-debug.log"
404
                export DBGP_IDEKEY=${debugger_key}
405
                export PLACK_DEBUG=1
406
                export PERL5OPT="-d"
407
            fi
408
409
            export PERL5LIB
410
411
            case $op in
412
                "start")
413
                    start_plack $name
414
                    ;;
415
                "stop")
416
                    stop_plack $name
417
                    ;;
418
                "restart")
419
                    restart_plack $name
420
                    ;;
421
                "enable")
422
                    enable_plack $name
423
                    ;;
424
                "disable")
425
                    disable_plack $name
426
                    ;;
427
                *)
428
                    usage
429
                    ;;
430
            esac
431
432
        else
440
        else
433
            if [ "$quiet" = "no" ]; then
441
            if [ "$quiet" = "no" ]; then
434
                log_daemon_msg "Error: Invalid instance name $name"
442
                log_daemon_msg "Error: Invalid instance name $name"
435
- 

Return to bug 25778