File scripts/worker.php changed (mode: 100644) (index 60086e3..ca9fb59) |
... |
... |
require_once($INC . "/conn.inc.php"); |
22 |
22 |
|
|
23 |
23 |
rg_prof_start('MAIN'); |
rg_prof_start('MAIN'); |
24 |
24 |
|
|
25 |
|
// TODO: use different files for different workers! |
|
26 |
|
rg_log_set_file($rg_log_dir . '/worker.log'); |
|
27 |
|
rg_log_set_sid("000000"); // to spread the logs |
|
28 |
|
|
|
29 |
25 |
if (!isset($_SERVER['argv'][1])) |
if (!isset($_SERVER['argv'][1])) |
|
26 |
|
$name = 'main'; |
|
27 |
|
else |
|
28 |
|
$name = $_SERVER['argv'][1]; |
|
29 |
|
|
|
30 |
|
if (!isset($_SERVER['argv'][2])) |
30 |
31 |
$conf_file = '/etc/rocketgit/worker.conf'; |
$conf_file = '/etc/rocketgit/worker.conf'; |
31 |
32 |
else |
else |
32 |
|
$conf_file = $_SERVER['argv'][1]; |
|
33 |
|
rg_log('conf_file=' . $conf_file); |
|
|
33 |
|
$conf_file = $_SERVER['argv'][2]; |
|
34 |
|
|
|
35 |
|
// TODO: use different files for different workers! |
|
36 |
|
rg_log_set_file($rg_log_dir . '/worker-' . $name . '.log'); |
|
37 |
|
rg_log_set_sid("000000"); // to spread the logs |
|
38 |
|
|
|
39 |
|
rg_log('name=' . $name . ' conf_file=' . $conf_file); |
34 |
40 |
|
|
35 |
41 |
/* |
/* |
36 |
42 |
* Load configuration file |
* Load configuration file |
File scripts/worker.sh changed (mode: 100755) (index 067f20c..99b77c7) |
7 |
7 |
# this is run in rocketgit_worker_t, so we cannot do it |
# this is run in rocketgit_worker_t, so we cannot do it |
8 |
8 |
#check_context |
#check_context |
9 |
9 |
|
|
10 |
|
exec 100<>/var/lib/rocketgit/locks/worker.sh.lock |
|
|
10 |
|
name="${1}" |
|
11 |
|
|
|
12 |
|
exec 100<>/var/lib/rocketgit/locks/worker-${name}.sh.lock |
11 |
13 |
|
|
12 |
14 |
flock --exclusive --nonblock 100 |
flock --exclusive --nonblock 100 |
13 |
15 |
if [ "${?}" != "0" ]; then |
if [ "${?}" != "0" ]; then |