A partner's conf is in the RAM cache, not CONF_DIR, and a commented-out template entry is not configuration
This commit is contained in:
@@ -643,6 +643,30 @@ function vv_read_conf_raw(string $filename): string {
|
||||
return file_exists($path) ? file_get_contents($path) : '';
|
||||
}
|
||||
|
||||
|
||||
// Read one HOST's conf, wherever that host's conf actually lives for this reader.
|
||||
//
|
||||
// Sparse checkout means a host only ever checks out its OWN host*.conf, so on HOST1 the file
|
||||
// Configurations/host2.conf does not exist and never will. vv_read_conf_raw() looks only in
|
||||
// CONF_DIR, so every caller that passed it a partner's slot silently got an empty string — and
|
||||
// an empty conf parses into empty arrays, which render as "none". The Watchdog tab showed the
|
||||
// partner's memory limits, required list, pause list, stop list and scan-ignore list as five
|
||||
// empty sections, and the Fallback tab reported the partner's tiers as unconfigured, on a mesh
|
||||
// where conf_sync had been delivering all of it into the RAM cache the whole time.
|
||||
//
|
||||
// Partner confs are pulled into VV_CONF_RAM_CACHE_DIR by System_Essentials/conf_sync.sh. Disk
|
||||
// first for this host, RAM cache for anyone else; the disk copy is never preferred for a
|
||||
// partner, because a stale Configurations/host2.conf left behind by an old install is exactly
|
||||
// the file that must not win. An absent cache returns empty, same as before.
|
||||
function vv_read_host_conf_raw(string $slot): string {
|
||||
$slot = strtolower($slot);
|
||||
if ($slot === vv_detect_host()) return vv_read_conf_raw($slot . '.conf');
|
||||
|
||||
$cached = rtrim(VV_CONF_RAM_CACHE_DIR, '/') . '/' . $slot . '.conf';
|
||||
if (is_readable($cached)) return (string)@file_get_contents($cached);
|
||||
|
||||
return '';
|
||||
}
|
||||
function vv_write_conf_raw(string $filename, string $content): bool {
|
||||
$path = CONF_DIR . '/' . $filename;
|
||||
$tmp = $path . '.vv.tmp';
|
||||
|
||||
Reference in New Issue
Block a user