|
Lines 62-67
$scriptname -h|--help
Link Here
|
| 62 |
--debugger-path Specify the path for the debugger library |
62 |
--debugger-path Specify the path for the debugger library |
| 63 |
--quiet|-q Make the script quiet about non existent instance names |
63 |
--quiet|-q Make the script quiet about non existent instance names |
| 64 |
(useful for calling from another scripts). |
64 |
(useful for calling from another scripts). |
|
|
65 |
--watch|-w Enable automatic reload to starman/plack when a file |
| 66 |
is modified (intended for development use) |
| 65 |
--help|-h Display this help message |
67 |
--help|-h Display this help message |
| 66 |
|
68 |
|
| 67 |
EOF |
69 |
EOF |
|
Lines 131-136
start_plack()
Link Here
|
| 131 |
# Go back to the original dir |
133 |
# Go back to the original dir |
| 132 |
cd "$current_dir" |
134 |
cd "$current_dir" |
| 133 |
|
135 |
|
|
|
136 |
# start watcher |
| 137 |
if [ "${watch}" = "yes" ]; then |
| 138 |
start_watcher $instancename |
| 139 |
fi |
| 140 |
|
| 134 |
else |
141 |
else |
| 135 |
log_daemon_msg "Error: Plack already running for ${instancename}" |
142 |
log_daemon_msg "Error: Plack already running for ${instancename}" |
| 136 |
log_end_msg 1 |
143 |
log_end_msg 1 |
|
Lines 152-163
stop_plack()
Link Here
|
| 152 |
else |
159 |
else |
| 153 |
log_end_msg 1 |
160 |
log_end_msg 1 |
| 154 |
fi |
161 |
fi |
|
|
162 |
|
| 163 |
# stop watcher |
| 164 |
if [ -f /var/run/koha/${instancename}/watcher.pid ]; then |
| 165 |
stop_watcher $instancename |
| 166 |
fi |
| 167 |
|
| 155 |
else |
168 |
else |
| 156 |
log_daemon_msg "Error: Plack not running for ${instancename}" |
169 |
log_daemon_msg "Error: Plack not running for ${instancename}" |
| 157 |
log_end_msg 1 |
170 |
log_end_msg 1 |
| 158 |
fi |
171 |
fi |
| 159 |
} |
172 |
} |
| 160 |
|
173 |
|
|
|
174 |
|
| 161 |
restart_plack() |
175 |
restart_plack() |
| 162 |
{ |
176 |
{ |
| 163 |
local instancename=$1 |
177 |
local instancename=$1 |
|
Lines 294-299
disable_plack()
Link Here
|
| 294 |
fi |
308 |
fi |
| 295 |
} |
309 |
} |
| 296 |
|
310 |
|
|
|
311 |
start_watcher() |
| 312 |
{ |
| 313 |
local instancename=$1 |
| 314 |
PIDFILE="/var/run/koha/${instancename}/watcher.pid" |
| 315 |
start-stop-daemon --pidfile ${PIDFILE} --start --background \ |
| 316 |
--make-pidfile --startas /usr/sbin/koha-watcher \ |
| 317 |
-- -d $KOHA_HOME ${instancename} |
| 318 |
} |
| 319 |
|
| 320 |
stop_watcher() |
| 321 |
{ |
| 322 |
local instancename=$1 |
| 323 |
PID=`cat /var/run/koha/${instancename}/watcher.pid` |
| 324 |
start-stop-daemon --ppid ${PID} --stop --retry=QUIT/5/KILL/10 |
| 325 |
} |
| 326 |
|
| 297 |
check_env_and_warn() |
327 |
check_env_and_warn() |
| 298 |
{ |
328 |
{ |
| 299 |
local apache_version_ok="no" |
329 |
local apache_version_ok="no" |
|
Lines 401-406
_do_instance() {
Link Here
|
| 401 |
STARMAN=$(which starman) |
431 |
STARMAN=$(which starman) |
| 402 |
op="" |
432 |
op="" |
| 403 |
quiet="no" |
433 |
quiet="no" |
|
|
434 |
watch="no" |
| 404 |
debug_mode="no" |
435 |
debug_mode="no" |
| 405 |
debugger_key="" |
436 |
debugger_key="" |
| 406 |
debugger_location="localhost:9000" |
437 |
debugger_location="localhost:9000" |
|
Lines 415-420
while [ $# -gt 0 ]; do
Link Here
|
| 415 |
-q|--quiet) |
446 |
-q|--quiet) |
| 416 |
quiet="yes" |
447 |
quiet="yes" |
| 417 |
shift ;; |
448 |
shift ;; |
|
|
449 |
-w|--watch) |
| 450 |
watch="yes" |
| 451 |
shift ;; |
| 418 |
--start) |
452 |
--start) |
| 419 |
set_action "start" |
453 |
set_action "start" |
| 420 |
shift ;; |
454 |
shift ;; |