diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-10-30 10:58:53 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-10-30 10:58:53 -0700 |
commit | dd187d067a88fcf2bc8a3de955ea87de406c6d30 (patch) | |
tree | dec7c361dae9e776ae91f186beb709686d603eb5 /scripts | |
parent | d6a2a698c256ec913321c859f3d1e85f1775a09d (diff) | |
download | vyatta-cfg-dd187d067a88fcf2bc8a3de955ea87de406c6d30.tar.gz vyatta-cfg-dd187d067a88fcf2bc8a3de955ea87de406c6d30.zip |
Sync config file after saving
By calling fsync, we can be more assured that file actually makes
it to disk.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-save-config.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/vyatta-save-config.pl b/scripts/vyatta-save-config.pl index e8220c0..9a95906 100755 --- a/scripts/vyatta-save-config.pl +++ b/scripts/vyatta-save-config.pl @@ -22,6 +22,7 @@ use strict; use lib "/opt/vyatta/share/perl5"; use Vyatta::ConfigOutput; +use File::Sync qw(fsync); my $etcdir = "/opt/vyatta/etc"; my $bootpath = $etcdir . "/config"; @@ -91,10 +92,11 @@ select $save; set_show_all(1); outputActiveConfig(); print $version_str; -close $save; - select STDOUT; +fsync $save; +close $save; + if ($mode eq 'url') { my $rc = system("curl -# -T $url_tmp_file $save_file"); system("rm -f $url_tmp_file"); |