summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-02-14 18:41:55 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-02-14 18:41:55 +0000
commiteb5814ae59f005f403d2a6b36798675351383961 (patch)
tree7f4caf90656583c014b4990b5af65ba1f5aa3842
parentd5d2c5145ab0a490257cff246ee48a3da7ee4d3e (diff)
downloadpfsense-eb5814ae59f005f403d2a6b36798675351383961.zip
pfsense-eb5814ae59f005f403d2a6b36798675351383961.tar.gz
Make sure we sync before mounting ro.
-rw-r--r--etc/inc/config.inc7
-rw-r--r--etc/inc/system.inc2
2 files changed, 9 insertions, 0 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 11e6377..f38cfc1 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -86,6 +86,7 @@ if(file_exists("/cf/conf/config.xml")) {
$fd = fopen("/cf/conf/config.xml", "w");
fwrite($fd, $config_contents);
fclose($fd);
+ mwexec("sync");
conf_mount_ro();
}
}
@@ -295,6 +296,7 @@ function generate_config_cache($config) {
$configcache = fopen($g['tmp_path'] . '/config.cache', "w");
fwrite($configcache, serialize($config));
fclose($configcache);
+ mwexec("sync");
conf_mount_ro();
config_unlock();
return true;
@@ -317,6 +319,7 @@ function restore_backup($file) {
unlink_if_exists("/tmp/config.cache");
log_error("pfSense is restoring the configuration $file");
file_notice("config.xml", "pfSense is restoring the configuration $file", "pfSenseConfigurator", "");
+ mwexec("sync");
conf_mount_ro();
}
config_unlock();
@@ -1071,6 +1074,7 @@ function write_config($desc="Unknown", $backup = true) {
}
if($g['booting'] <> true) {
+ mwexec("sync");
conf_mount_ro();
}
@@ -1122,6 +1126,7 @@ function reset_factory_defaults() {
/* call the wizard */
touch("/conf/trigger_initial_wizard");
+ mwexec("sync");
conf_mount_ro();
config_unlock();
@@ -1142,6 +1147,7 @@ function config_restore($conffile) {
$config = parse_config(true);
write_config("Reverted to " . array_pop(explode("/", $conffile)) . ".", false);
+ mwexec("sync");
conf_mount_ro();
config_unlock();
@@ -1792,6 +1798,7 @@ function backup_config() {
fwrite($bakout, serialize($backupcache));
fclose($bakout);
+ mwexec("sync");
conf_mount_ro();
return true;
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index a6a1668..944a93e 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -81,6 +81,7 @@ EOFF;
fwrite($fd, $php_ini);
fclose($fd);
+ mwexec("sync");
conf_mount_ro();
exec("sync");
config_unlock();
@@ -984,6 +985,7 @@ function system_timezone_configure() {
exec("LANG=C /usr/bin/tar xzfO /usr/share/zoneinfo.tgz " .
escapeshellarg($timezone) . " > /etc/localtime");
+ mwexec("sync");
conf_mount_ro();
if ($g['booting'])
OpenPOWER on IntegriCloud