mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
backup: fix infinite reboot loop; fixes #255
/var/run was cleared out before, but we'd rather not keep it this way... It is for pid files, nothing else. Move the terrible firmware dirty markers to /tmp instead. Eventually, we need a better way to keep track of subsystem state. Cluttering multiple files all over the disk is not a good solution.
This commit is contained in:
parent
b3240ac652
commit
d2c4efe0be
@ -66,7 +66,7 @@ function is_subsystem_dirty($subsystem = '')
|
||||
return false;
|
||||
}
|
||||
|
||||
if (file_exists("/var/run/{$subsystem}.dirty")) {
|
||||
if (file_exists("/tmp/{$subsystem}.dirty")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -75,14 +75,12 @@ function is_subsystem_dirty($subsystem = '')
|
||||
|
||||
function mark_subsystem_dirty($subsystem = '')
|
||||
{
|
||||
if (!file_put_contents("/var/run/{$subsystem}.dirty", 'DIRTY')) {
|
||||
log_error(sprintf(gettext("WARNING: Could not mark subsystem: %s dirty"), $subsystem));
|
||||
}
|
||||
touch("/tmp/{$subsystem}.dirty");
|
||||
}
|
||||
|
||||
function clear_subsystem_dirty($subsystem = '')
|
||||
{
|
||||
@unlink("/var/run/{$subsystem}.dirty");
|
||||
@unlink("/tmp/{$subsystem}.dirty");
|
||||
}
|
||||
|
||||
/* lock configuration file */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user