JanKr,

> since a few days I have a problem with amavisd-new.
> amavis.log rotate midnight but the new amavis.log have wrong
> permissions (640).
> in the past the new logfiles never change the permission...

On amavisd restart (if logging to a file), it opens/creates a
file as root and then changes its ownership as follows:

  $loghandle->open($logfile, O_CREAT|O_APPEND|O_WRONLY, 0640)
  [...]
  chown($uid, -1, $logfile);

This hasn't changes in a while (and I must say I don't like opening
a log file as root, but is useful to have a log open even before
daemonizing and changing uid).

> no email can deliver and when I restart amavis:
> Starting amavisd: Failed to open log file /var/log/amavis.log: Permission
> denied at /usr/sbin/amavisd-new line 1822.
> (failed). when I change the log to 777 it works...
> /etc/cron.daily/sysklogd:
>   savelog -g adm -m 640 -u root -c 14 $LOG >/dev/null
> so here savelog give 640... I could change it to 777 -.-

Don't know how this log rotation works, and I do not care for it much.
Logging directly to a file is inefficient (lock/position/write/flush/unlock
for every write), and is problematic with log rotation, which must be
coordinated with restarting amavisd.

The only recommended way of logging is through syslog. There you have
full control on what and where to log, is efficient, and there is
a standard way of doing log rotation which applications need not be
aware of.

  Mark

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 
 AMaViS-HowTos:http://www.amavis.org/howto/ 

Reply via email to