Bug 473419 - File creation will be disabled when setting CreateDirs to off
File creation will be disabled when setting CreateDirs to off
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rsyslog (Show other bugs)
5.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Tomas Heinrich
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-28 07:38 EST by William Tisäter
Modified: 2016-09-20 00:49 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-30 04:17:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch for enabling file creation when directory creation is turned off (2.19 KB, patch)
2008-11-28 07:38 EST, William Tisäter
no flags Details | Diff
Fix RS_RET_ERR catch in syslogd.c (354 bytes, patch)
2008-12-12 11:24 EST, 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 08:08 EST, William Tisäter
no flags Details | Diff

  None (edit)
Description William Tisäter 2008-11-28 07:38:30 EST
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 11:24:07 EST
Created attachment 326738 [details]
Fix RS_RET_ERR catch in syslogd.c
Comment 2 William Tisäter 2008-12-16 04:12:36 EST
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 04:14:43 EST
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 08:08:22 EST
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 04:17:11 EDT
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.