Add Yunohost setup guide and make the poller lock per-script
The poller's lock file in /tmp could be left owned by another user after a manual run, leaving cron unable to open it. Lock the script file instead. SETUP.md walks through installing the site on Yunohost, including the /etc/cron.d entry for the poller, which was missing on the server and left the recently played list empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5c5e2e17ba
commit
6e8b473dff
3 files changed
+210
-3
No files matched your search
@@ -11,8 +11,13 @@ if (PHP_SAPI !== 'cli') {
|
||||
require __DIR__ . '/../includes/db.php';
|
||||
require __DIR__ . '/../includes/broadcasts.php';
|
||||
|
||||
// Skip this run if the previous one is still going
|
||||
$lock = fopen(sys_get_temp_dir() . '/rfe_poll_icecast.lock', 'c');
|
||||
// Skip this run if the previous one is still going. Locks this script rather than a file in /tmp,
|
||||
// which another user (e.g. a manual run over SSH) could own and leave unopenable for cron.
|
||||
$lock = fopen(__FILE__, 'r');
|
||||
if ($lock === false) {
|
||||
fwrite(STDERR, date('c') . " Unable to open lock\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!flock($lock, LOCK_EX | LOCK_NB)) exit;
|
||||
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
|
||||
Reference in new issue
Block a user