Koozali.org: home of the SME Server

Increase qpsmtpd log retention

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Increase qpsmtpd log retention
« on: July 14, 2006, 06:15:01 PM »

Objective:

   Increase the retention period for qpsmtpd log files
(edited 2006-11-14 to correct the "kill -sigterm..." command)

Procedure:

# vi /var/service/qpsmtpd/log/run
   change
/usr/local/bin/multilog t s5000000  \
   to
/usr/local/bin/multilog t s5000000  n50 \

# kill -sigterm `cat /var/service/qpsmtpd/log/supervise/pid`

Notes:
My SME 7.0 (Final) server was only maintaining about 10 hours worth of qpsmtpd log files.  By the time I heard about problems from my overseas users there was nothing left in the log files.

This procedure will cause multilog to keep 50 log files instead of the default 10 - hopefully giving me at least 2 - 3 days to be able to research problems.  You could also change the numeric part of "s5000000" in order to change the size of each individual log file, or you could config setprop qpsmtpd LogLevel to change the amount of detail kept by qpsmtpd.  The default log level of 8 includes debug-level messages.  The developers briefly reduced the default from 8 to 6 but found that this did not include many of the "DENY" and "DENYSOFT" messages.

Total qpsmtpd log file size will be 50 * 5000000 or 250MB.

I couldn't find any templates that looked like they would end up un-doing changes made directly to /var/service/qpsmtpd/log/run.

Offline byte

  • *
  • 2,183
  • +2/-0
Increase qpsmtpd log retention
« Reply #1 on: July 14, 2006, 07:48:45 PM »
Did you say you created the templates for this change? if not on a reboot you will lose the changes.

If the templates are not there then you need to create them, have a read of the new draft Dev guide for info on how to do that if you are unsure.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Increase qpsmtpd log retention
« Reply #2 on: July 14, 2006, 09:34:56 PM »
The file in question - /var/service/qpsmtpd/log/run - does not appear to be controlled by the templating function.

I ran "signal-event reboot" with no change, then tried "signal-event post-upgrade" followed by "signal-event reboot" - still with no change to /var/service/qpsmtpd/log/run.

If some process ever does change this file I don't know whether it would "respect" a custom template...

I suppose I could create a custom template, then also (somehow) modify the email-update action to apply that template whenever email-update is run... but this seems very presumptuous for a non-programmer like myself!

Offline JonB

  • *
  • 351
  • +0/-0
Increase qpsmtpd log retention
« Reply #3 on: July 15, 2006, 12:41:57 AM »
Correct, this is not templated. However everytime there is an update for qpsmtpd it will be reverted back to the default which is 10 logs.

It may be worth while creating a New Feature bug to get this templated based on a value in the database.

Jon
...

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Increase qpsmtpd log retention
« Reply #4 on: July 17, 2006, 06:34:18 PM »
Added to bugzilla as a "New Feature Request" for v7.1: http://bugs.contribs.org/show_bug.cgi?id=1743

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Increase qpsmtpd log retention
« Reply #5 on: November 14, 2006, 02:59:13 PM »
Quote from: "JonB"
...this is not templated. However everytime there is an update for qpsmtpd it will be reverted back to the default which is 10 logs.
Right you are!  The qpsmtpd update included in the 2006-11-07 updates reverted qpsmtpd back to 10 logs...