Skip to main content

cause of "Cannot open main log file "/var/log/exim/mainlog": Permission denied" - exicyclog?



  • cPanelMichael
    Hello :) It looks like the error message is generated during the time frame when the Exim mainlog does not exist. You may want to modify your exicyclog script to run less often, or to rotate the log rather than moving it with that cron job. Thank you.
  • grc
    Thank you for your suggestions. The exicyclog script comes with Exim and is recommended to be run as a cronjob. So I thought someone has had the same problem and I would not have to re-invent the wheel :) or that I am on the wrong track. Btw: This does not happen very often, about every 5000th time exicyclog runs (estimated over the number of exim servers). Less often than hourly is unfortunately not an option. At this point I think the following modification of exicyclog may be worth a try: if [ -f $mainlog ]; then # modification 20131010 # make sure the new mainlog has been created, # has the right permission $touch $ $chown $user:$group $ $chmod 640 $ $mv $mainlog $mainlog.$first # ...and then move it into place ;should take less time $mv $mainlog.tmp $mainlog $chown $user:$group $mainlog.$first fi

Please sign in to leave a comment.