From bb9f6963579816c0209a2a7d5510689a043dd965 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 21 Jun 2011 10:13:04 -0700 Subject: [PATCH] ovs-ctl: Clean up temporary file used for force-reload-kmod. Suggested-by: Andrew Evans --- utilities/ovs-ctl.in | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index a127149a..44afbd27 100755 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -233,7 +233,8 @@ force_reload_kmod () { stop script=`mktemp` - if action "Save interface configuration to $script" save_interfaces; then + trap 'rm -f "$script"' 0 1 2 13 15 + if action "Saving interface configuration" save_interfaces; then : else log_warning_msg "Failed to save configuration, not replacing kernel module" @@ -252,7 +253,16 @@ force_reload_kmod () { start - action "Restore interface configuration from $script" "$script" + action "Restoring interface configuration" "$script" + rc=$? + if test $rc = 0; then + level=debug + else + level=err + fi + log="logger -p daemon.$level -t ovs-save" + $log "force-reload-kmod interface restore script exited with status $rc:" + $log -f "$script" } ## ---- ## -- 2.30.2