Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a debian package that sets up awstats and the required scripts for a couple of hostnames in a server I have.
My problem is with logrotate, I already update the stats with a cron job I set up on package install but I need to update stats on server logs prerotate, gthe server I'm using, lighttpd, already has an entry on /etc/logrotate.d/.

I guess I could just sed the file and add the prerotate update stats endscript but that wouldn't work later when the package gets uninstalled, and I doubt it'll survive a lighttpd package update.

Any ideas?

share|improve this question
up vote 4 down vote accepted

Debian won't touch your conffiles once you have edited them; you can edit lighttpd's logrotate script all you want. You might get prompted at upgrades if both lighttpd and you have updated the file.

If you want changes to be applied on your own package's install, divert the lighttpd conffile in your package's install scripts, and install the awstats-aware version in its place. Look up dpkg-divert.

share|improve this answer
Well answered :) +1 – Arenstar Nov 14 '10 at 3:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.