Menu

#105 check_log perms wrong & rm's /bin/mktemp

open
nobody
None
5
2002-03-20
2002-03-20
Anonymous
No

I have netsaint 0.0.7b6 and latest plugins installed
on a redhat 6.2 box.

I just started using check_log to monitor three local
logfiles. I started getting errors regarding unable
to create /tmp/check_log.XXXXX etc.

I checked, /bin/mktemp was missing. rpm -q mktemp
should that it was installed. rpm -i --force mktemp-
1.5-2.i386.rpm put it back.

Stop netsaint, remove the old /tmp/ logfiles, start
netsaint again, and /tmp/* 'old' logfiles get created
as user root, instead of user netsaint.

Also, the on line in check_log :

# The temporary file that the script should use while
# processing the log file.
if [ -x /bin/mktemp ]; then
tempdiff="/bin/mktemp /tmp/check_log.XXXXXXXXXX"

That last line. Those double quotes should be
backticks, because the double quotes causes the
$RM -f $tempdiff
line further on to actually remove /bin/mktemp in
certain cases. Not sure why though, because netsaint
starts up as user "netsaint", but for some reason the
old logfiles get created as user root, and the $RM
line gets executed as root, and thus
deletes /bin/mktemp

Thanks
Aubrey Kilian
South-Africa

Discussion


Log in to post a comment.

MongoDB Logo MongoDB