diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-02-14 18:41:55 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-02-14 18:41:55 +0000 |
commit | eb5814ae59f005f403d2a6b36798675351383961 (patch) | |
tree | 7f4caf90656583c014b4990b5af65ba1f5aa3842 /etc/inc/config.inc | |
parent | d5d2c5145ab0a490257cff246ee48a3da7ee4d3e (diff) | |
download | pfsense-eb5814ae59f005f403d2a6b36798675351383961.zip pfsense-eb5814ae59f005f403d2a6b36798675351383961.tar.gz |
Make sure we sync before mounting ro.
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r-- | etc/inc/config.inc | 7 |
1 files changed, 7 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; |