summaryrefslogtreecommitdiff
path: root/update_daemon2.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2008-01-24 10:20:00 +0100
committerAndrew Dolgov <[email protected]>2008-01-24 10:20:00 +0100
commita65a05a72e5f736cd81791fc18181a9c43f7a496 (patch)
tree14b26b6612db1dd33950dd99a23132d367fab28c /update_daemon2.php
parentc29324c7a4d35c6feac3ff7d2557a265e0c4cc35 (diff)
update_daemon2: only set SIGINT handler in lock managing subprocess
Diffstat (limited to 'update_daemon2.php')
-rw-r--r--update_daemon2.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/update_daemon2.php b/update_daemon2.php
index 326b69e49..e7b5aeb20 100644
--- a/update_daemon2.php
+++ b/update_daemon2.php
@@ -61,7 +61,7 @@
}
function sigalrm_handler() {
- die("received SIGALRM, hang in feed update?\n");
+ die("[SIGALRM] hang in feed update?\n");
}
function sigchld_handler($signal) {
@@ -74,12 +74,11 @@
function sigint_handler() {
unlink(LOCK_DIRECTORY . "/update_daemon.lock");
- die("Received SIGINT. Exiting.\n");
+ die("[SIGINT] removing lockfile and exiting.\n");
}
pcntl_signal(SIGALRM, 'sigalrm_handler');
pcntl_signal(SIGCHLD, 'sigchld_handler');
- pcntl_signal(SIGINT, 'sigint_handler');
if (file_is_locked("update_daemon.lock")) {
die("error: Can't create lockfile. ".
@@ -92,6 +91,8 @@
}
if (!pcntl_fork()) {
+ pcntl_signal(SIGINT, 'sigint_handler');
+
$lock_handle = make_lockfile("update_daemon.lock");
if (!$lock_handle) {
@@ -282,7 +283,7 @@
if (DAEMON_SENDS_DIGESTS) send_headlines_digests($link);
- print "Elapsed time: " . (time() - $start_timestamp) . " second(s)\n";
+ _debug("Elapsed time: " . (time() - $start_timestamp) . " second(s)");
db_close($link);