> I would like to get opinions about this:
> 
> I have the following line in my rsyslog conf:
> $template DynFile,"/var/log/syslog-%HOSTNAME%"
> *.*;auth,authpriv.none  ?DynFile
> 
> And it is not working.
At a glance it looks ok. Try invoking rsyslog with -N1 to see if it
complains about your configuration.

> After hours of different tries realized if i remove ;auth,authpriv.none
> It starts to work magically.
> $template DynFile,"/var/log/syslog-%HOSTNAME%"
> *.*  ?DynFile
> 
> However i had to touch the files manually because these error messages
> appeared in the log:
> rsyslogd: Could not open dynamic file '/var/log/syslog-XXX' - discarding 
> message
The dynamic files aren't created when rsyslog starts, so it needs
permission to write them after it drops permissions (the default
configuration in Ubuntu). If you try to write the file to /var/log
(which you are) you will get this error because /var/log is owned by
root and syslog cannot write new files there. At our site we work around
this by creating a new folder owned by syslog.

> It is an Ubuntu 10.04 LTS with the repo install of rsyslog 4.2.0
The important lines to note are these:
$PrivDropToUser syslog
$PrivDropToGroup syslog

Which are why the file can't be created dynamically in /var/log.

> Do you have any idea what the problem with my original try and why
> rsyslog cannot open logfiles?

-Ryan Kelly
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to