Bug 11606

Summary: incorrect log rotation in samba-2.0.7-4.i386.rpm
Product: [Retired] Red Hat Linux Reporter: mal
Component: logrotateAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: djh, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-07-13 16:30:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description mal 2000-05-23 16:03:08 UTC
Hi, the package samba-2.0.7-4.i386.rpm
from Redhat 6.2 updates still does not solve
a problem with log rotation.
Currently it:
1. Rotates files which are the result of log
   rotatin (*.1 *.2, etc).
2. fails on log files produced by a host
	whith a space in its NETBIOS name.
This is precisely what I previosly reported on March 1, 2000 in

There is, from my point of view,
a serios problem with how RedHat bug tracking is organized.
Usually, after a bug is reported,
somebody from RedHat gives a short response
(often without proper evaluation)
and marks the bug resolved.
Once the bug is marked as resolved all futher information
about it is just ignored.
This happened many times with many different bugs.
My proposal is to change the procdure, i.e.
bug may be marked as resolved only after
it was confirmed as fixed by a reporter.

Comment 1 Neil Darlow 2000-06-24 10:31:11 UTC
Caused, I think, by the use of log.* in /etc/logrotate.d/samba.

Log files either need to be specified explicitly or some means of preventing
generation of successive .N extensions by logrotate needs to be found.

Comment 2 Bill Nottingham 2000-06-27 15:31:33 UTC
With these problems, is there any reason that logrotate should
be used instead of samba to rotate the logs (I'm not seeing

Comment 3 mal 2000-06-27 16:10:41 UTC
Logrotate is perfectly OK if you:

1. Set samba log files pattern to *.log
2. Fix logrotate to work with files which has spaces and other 
	special symbols in it. You will need to fix this 
	anyway for the other programs. Many programs can generate
	log files with strange names.

Comment 4 mal 2000-06-27 16:18:56 UTC
In addition to mentioned above reasons 
there are the following other reasons:
1. Samba rotates logs quite inconsistently in accordance 
	with its own strange algorithm.
	Using logrotate you have common framework for all log files rotation.
2. You can get it to work fine with very minor changes
	and one fix to logrotate (which should be done anyway).
	I posted the changes required in my previos posting.

Comment 5 Bill Nottingham 2000-06-27 16:24:26 UTC
samba changes are in 2.0.7-10. Reassigned to logrotate
for the rest of the fixes.

Comment 6 mal 2000-06-27 16:39:32 UTC
The easiest wy to fix logrotate
is to use 
URLEcoded format for file names.
You can just use two
C functions which do same thing as
escape and unescape
from perl module /usr/lib/perl5/5.00503/CGI.pm.
when you save to  /var/lib/logrotate.status
escape file as by using a function
equivalent to CGI::escape
and after you read the string from the file
use a function equivalent to CGI::unescape.
This way you will fix all the problems 
with file names containing special symbols in logrotate.
The mentioned functions escape and unescape 
are standard and may be found in many reference 
I recommend to name them 
like logrotate_escape and logrotate_unescape
to avoid possible clashes with functions from C library.

Comment 7 Erik Troan 2000-07-13 16:30:25 UTC
Logrotate support white problems now -- tthe * matching .1 needs to be fixed in
config file.

Comment 8 Bill Nottingham 2000-07-15 18:46:09 UTC
OK, with the combination of samba-2.0.7-10 or higher, and logrotate-3.4
or higher, this should be fixed.

Comment 9 openshift-github-bot 2016-11-09 01:05:45 UTC
Commit pushed to master at https://github.com/openshift/origin

Merge pull request #11807 from jim-minter/issue11606

Merged by openshift-bot