Description of problem:
[ -n "$LOG_FILE" ] || LOG_FILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP )
LOG_FILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP )
which sets DO_LOG=true and fails to set LOG_FILE because on RHEL-5 mktemp doesn't support --tmpdir option.
later on LOG_FILE is set to /dev/null via
[ -n "$LOG_FILE" ] || LOG_FILE="/dev/null"
at the end of the function there is:
elif $DO_LOG; then
which removes /dev/null.
Beside fixing the --tmpdir issue I think either of following options would do the job.
set [ -n "$LOG_FILE" ] || LOG_FILE="/dev/null" && DO_LOG=false
elif $DO_LOG && [ "$LOG_FILE" != /dev/null ]; then
I am using
(In reply to Karel Srot from comment #0)
> Beside fixing the --tmpdir issue
"tmpdir -p $__INTERNAL_PERSISTENT_TMP" should do the job
*** Bug 968381 has been marked as a duplicate of this bug. ***
Moving this to internal product, as I will fix this in RHEL packages only.
Okay: when LOG_FILE fails to be created (and /dev/null is used instead), it's probably a BeakerLib problem. In this case the advanced switches are turned off, and therefore the LOG_FILE is not erased.
And this part is clearly not urgent (the --tmpdir part probably is, but that's different story)
(In reply to Petr Muller from comment #6)
> And this part is clearly not urgent (the --tmpdir part probably is, but
> that's different story)
If /dev/null is deleted it is recreated as a regular file by any script running >/dev/null. Such a file has wrong selinux context and various services (and therefore also a lot of tests) do not work properly because they cannot access /dev/null (snmpd as an example).
Yep, but /dev/null should be never used for logging in the first place. When the tmp file is created, then /dev/null is not used and therefore not removed.
This remains simply a robustification and better handling of weird error states, but with the wrong mktemp call, we are *causing* weird error state.
But, it's just paper pushing. I'll try to push both fixes in one batch, and will try to do it soon.
beakerlib-1.8-1.fc19 has been submitted as an update for Fedora 19.
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing beakerlib-1.8-1.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
beakerlib-1.8-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.