Bug 473419 - File creation will be disabled when setting CreateDirs to off
Summary: File creation will be disabled when setting CreateDirs to off
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rsyslog
Version: 5.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Tomas Heinrich
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-28 12:38 UTC by William Tisäter
Modified: 2016-09-20 04:49 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:17:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch for enabling file creation when directory creation is turned off (2.19 KB, patch)
2008-11-28 12:38 UTC, William Tisäter
no flags Details | Diff
Fix RS_RET_ERR catch in syslogd.c (354 bytes, patch)
2008-12-12 16:24 UTC, William Tisäter
no flags Details | Diff
Patch for enabling file creation when directory creation is turned off take two (4.21 KB, patch)
2008-12-16 13:08 UTC, William Tisäter
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0213 0 normal SHIPPED_LIVE rsyslog bug fix update 2010-03-29 12:31:05 UTC

Description William Tisäter 2008-11-28 12:38:30 UTC
Created attachment 324985 [details]
Patch for enabling file creation when directory creation is turned off

Description of problem:
When configuring rsyslog to not create directories ($CreateDirs off) it will also turn off the creation of regular files. This means you have to turn directory creation on and open up for anybody to create directories in your log directory.

Steps to Reproduce:

/etc/rsyslog.cfg:
$CreateDirs off
$template DirByTagFileByDay,"/log/%programname%/%timegenerated:1:10:date-rfc3339%.log"
local0.* -?DirByTagFileByDay

In your shell:
# mkdir /log/MyNewDir
# logger -p local0.crit -t MyNewDir "text content"

Actual results:

# ls -l /log/MyNewDir
total 0

Expected results:

# ls -l /log/MyNewDir
total 4
-rw-r--r-- 1 root root 43 Nov 28 13:29 2008-11-28.log

Additional info:

The patch attached will let you turn directory creation off and still be able to create files within already existing directories.

Comment 1 William Tisäter 2008-12-12 16:24:07 UTC
Created attachment 326738 [details]
Fix RS_RET_ERR catch in syslogd.c

Comment 2 William Tisäter 2008-12-16 09:12:36 UTC
Comment on attachment 326738 [details]
Fix RS_RET_ERR catch in syslogd.c

Did not work well.. hanged the daemon.

Comment 3 William Tisäter 2008-12-16 09:14:43 UTC
The fix almost works, but there seems to be some mode where log entries get rejected and starts to loop. I then get 20-30k entries per minute.

I'm now trying to use the debug mode to find out how this can happen...

Comment 4 William Tisäter 2008-12-16 13:08:22 UTC
Created attachment 327100 [details]
Patch for enabling file creation when directory creation is turned off take two

Alright... here we go. This one should actually discard the message.

My previous patch did not remove the entry from the queue and kept on trying to write to the missing file. We also had a scenario of the "repeat loop" not being able to recognize the previous delivery failure.

Comment 11 errata-xmlrpc 2010-03-30 08:17:11 UTC
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-2010-0213.html


Note You need to log in before you can comment on or make changes to this bug.