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:
Franco Fichtner 2015-07-12 06:14:27 +02:00
parent b3240ac652
commit d2c4efe0be

View File

@ -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 */