Hide Forgot
There are a number of places in fence_scsi where the script executes a command via Perl's qx function. Most of these are for executing sg_persist commands. Currently the script does nothing more than: $out = qx { $cmd }; die "[error]: $self\n" if ($?>>8); If an error occurs executing the command, the script simply dies and reports the name of the subroutine. This can be improved in two ways: 1. Redirect stderr to /dev/null. 2. Log any errors with log_error. Redirecting stderr to /dev/null keeps some garbage from the sg_persist commands from making its way into the logs. This is a very minor change. Using log_error instead of simply calling die is preferable since it will write a properly formatted to the logfile. The improved code would do replace the qx and die calls with: $out = qx { $cmd 2> /dev/null }; $err = ($?>>8); if ($err != 0) { log_error ("$self (err=$err)"); } This code will correctly write the error to the logfile and include the error code, which might be useful for debugging purposes.
Created attachment 475217 [details] Log errors with log_error and redirect stderr to /dev/null.
Pushed to RHEL6 branch. commit b3e375c0554149173390b542de1ef3674da3d128
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0745.html