[Bug 878857] Re: Privileges problems while creating dynamic logfiles

Launchpad Bug Tracker 878857 at bugs.launchpad.net
Wed Sep 19 08:47:06 UTC 2012


*** This bug is a duplicate of bug 484336 ***
    https://bugs.launchpad.net/bugs/484336

Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: rsyslog (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rsyslog in Ubuntu.
https://bugs.launchpad.net/bugs/878857

Title:
  Privileges problems while creating dynamic logfiles

Status in “rsyslog” package in Ubuntu:
  Confirmed

Bug description:
  System: Ubuntu LTS 10.04.3 x86_64
  Kernel: 2.6.32-33-server
  Package: rsyslog 4.2.0-2ubuntu8.1

  Problem: when adding rules to create files based on templates rsyslog reports the following error:
  rsyslogd: Could not open dynamic file '/srv/log/apache2/vhostname_access_log.20111020' - discarding message

  files and directories however getting created with the following mask:

  drwxr-xr-x 2 syslog syslog  4096 2011-10-20 13:22 apache2
  -rw-r----- 1 syslog syslog    1125 2011-10-20 13:23 eurwebtest03.eurweb_access_log.20111020

  if i change the mask of the logfile to
  -rw-r----- 1 syslog adm    1125 2011-10-20 13:23 eurwebtest03.eurweb_access_log.20111020

  it is starting to work magically.

  Default ubuntu rsyslog settings:
  $FileOwner syslog
  $FileGroup adm
  $FileCreateMode 0640
  $DirCreateMode 0755
  $Umask 0022
  $PrivDropToUser syslog
  $PrivDropToGroup syslog

  Rules I added:

  rsyslog:
  $template ApacheLogFormat,"%msg:2:10000%\n"
  $template local6error,"/srv/log/apache2/%programname:13:50%_error_log.%$YEAR%%$MONTH%%$DAY%"
  $template local6access,"/srv/log/apache2/%programname:14:50%_access_log.%$YEAR%%$MONTH%%$DAY%"

  if $syslogfacility-text == 'local6' and $programname startswith 'httpd_error' then -?local6error;ApacheLogFormat
  #& ~

  if $syslogfacility-text == 'local6' and $programname startswith 'httpd_access' then -?local6access;ApacheLogFormat
  #& ~

  apache2:
  ErrorLog "|/usr/bin/logger -p local6.warn -t httpd_error_vhostname"
  CustomLog "|/usr/bin/logger -p local6.info -t httpd_access_vhostname" combined

  With the situation above rsyslog should have been able to write those created logfiles. I think it is a pretty annoying bug.
  I dont want to remove PrivDrop and nor want to add a cronjob to change the right mask all the newly created files.

  Please tell me if I have to provide further information. We are using
  LTS in production enviroment as it should be long term and fairly bug
  free OS.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/878857/+subscriptions




More information about the foundations-bugs mailing list