From: Ben Pfaff Date: Tue, 21 Jun 2011 17:13:04 +0000 (-0700) Subject: ovs-ctl: Clean up temporary file used for force-reload-kmod. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb9f6963579816c0209a2a7d5510689a043dd965;p=openvswitch ovs-ctl: Clean up temporary file used for force-reload-kmod. Suggested-by: Andrew Evans --- 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" } ## ---- ##