Ticket #835 (closed defect: invalid)

Opened 10 months ago

Last modified 4 months ago

Add awstats_updateall.pl to logrotate config

Reported by: Cube Assigned to: rats
Priority: major Milestone: ispCP ω 1.0.0 - RC3
Component: Backend (Engine) Version: ispCP ω 1.0.0 - DEV
Severity: Hard Keywords: awstats
Cc:

Description

awstats_updateall.pl should be added to the logrotate config for the apache logs as a command in the prerotate part. Either this will be done with the install of ispcp or it should be mentioned in the install docs.

Without this command the log entries between the rotate and the next run of awstats_updateall.pl or awstats_buildstaticpages.pl are not analyzed by awstats.

Forum thread about this and other topics

Attachments

patch_awstats_logrotate.sh (402 bytes) - added by dominiquearpin on 11/22/07 22:18:17.
patch_awstats.txt (1.2 kB) - added by dominiquearpin on 11/29/07 15:38:22.
patch_awstats.2.txt (1.2 kB) - added by dominiquearpin on 11/29/07 15:40:32.
v2
patch_awstats.3.txt (1.8 kB) - added by dominiquearpin on 11/29/07 16:45:31.
v3
patch_awstats.4.txt (1.8 kB) - added by dominiquearpin on 11/29/07 16:55:58.
Add the output to /dev/null
patch_awstats.5.txt (1.8 kB) - added by anonymous on 11/29/07 19:25:33.
typo error, it's working, but i will rewrite it
patch.txt (1.4 kB) - added by dominiquearpin on 11/29/07 19:39:56.
sorry for the noise.... I clean my code
patch.2.txt (1.4 kB) - added by dominiquearpin on 11/29/07 20:25:29.
type error.... and sorry again
patch.3.txt (1.6 kB) - added by dominiquearpin on 11/30/07 17:30:05.
patch for v933
patch.4.txt (0.8 kB) - added by dominiquearpin on 11/30/07 18:20:16.
its the right one

Change History

11/03/07 03:31:47 changed by raphael

  • owner set to rats.
  • version changed from ispCP ω 1.0.0 - RC2 to ispCP ω 1.0.0 - DEV.

11/22/07 22:17:44 changed by dominiquearpin

add a patch file. I dont know where to put this.

11/22/07 22:18:17 changed by dominiquearpin

  • attachment patch_awstats_logrotate.sh added.

11/29/07 10:18:40 changed by rats

  • status changed from new to closed.
  • resolution set to fixed.

thank you for the patch dominique. I integrated it into the setup! -> r930

(follow-up: ↓ 5 ) 11/29/07 13:30:40 changed by Cube

  • status changed from closed to reopened.
  • resolution deleted.

This is wrong. You've added it to the postrotate part, so AWStats analyzes the new empty file. It should be in the prerotate part and sharedscripts should also be set.

sharedscripts
prerotate
.... awstats_updateall.pl ....
endscript

(in reply to: ↑ 4 ) 11/29/07 15:37:50 changed by dominiquearpin

Here the new patch @Cube: the sharescripts is already set in my debian systeme by default.

11/29/07 15:38:22 changed by dominiquearpin

  • attachment patch_awstats.txt added.

11/29/07 15:40:32 changed by dominiquearpin

  • attachment patch_awstats.2.txt added.

v2

11/29/07 15:47:09 changed by rats

  • status changed from reopened to closed.
  • resolution set to fixed.

oooops - fixed and another issue in r931 oh, Dominique you've been to slow ~gg~

11/29/07 16:31:31 changed by Cube

  • status changed from closed to reopened.
  • resolution deleted.

I'm sorry for reopening it again, but I've forgot to mention it before.
The output of the script should go to /dev/null like it's done in the ispcp-crontab. Otherwise cron will send us daily useless mails.

11/29/07 16:44:56 changed by dominiquearpin

@Rats: here a new patch. Now the script check if the file is already patched. I'm not a programmer, so my code isn't perfect and I didn't test it.

11/29/07 16:45:31 changed by dominiquearpin

  • attachment patch_awstats.3.txt added.

v3

11/29/07 16:55:58 changed by dominiquearpin

  • attachment patch_awstats.4.txt added.

Add the output to /dev/null

11/29/07 19:25:33 changed by anonymous

  • attachment patch_awstats.5.txt added.

typo error, it's working, but i will rewrite it

11/29/07 19:39:56 changed by dominiquearpin

  • attachment patch.txt added.

sorry for the noise.... I clean my code

11/29/07 20:25:29 changed by dominiquearpin

  • attachment patch.2.txt added.

type error.... and sorry again

11/29/07 23:08:49 changed by rats

  • status changed from reopened to closed.
  • resolution set to fixed.

looks good, and seems to work. You'll find it in r932!

11/30/07 00:12:35 changed by dominiquearpin

  • status changed from closed to reopened.
  • resolution deleted.

replace: if (-f "/etc/logrotate.d/apache" . $apache_file) { by: if (-f "/etc/logrotate.d/" . $apache_file) {

11/30/07 00:14:24 changed by rats

  • status changed from reopened to closed.
  • resolution set to fixed.

11/30/07 17:30:05 changed by dominiquearpin

  • attachment patch.3.txt added.

patch for v933

11/30/07 17:33:31 changed by dominiquearpin

  • status changed from closed to reopened.
  • resolution deleted.

11/30/07 18:20:16 changed by dominiquearpin

  • attachment patch.4.txt added.

its the right one

11/30/07 23:33:27 changed by rats

  • status changed from reopened to closed.
  • resolution set to fixed.

fixed in r936 (best way)

12/09/07 14:40:24 changed by Cube

  • status changed from closed to reopened.
  • resolution deleted.

Is it really so difficult? I installed latest trunk on a fresh system and the generated apache2 logrotate config looks like this:

/var/log/apache2/*.log {
	weekly
	missingok
	rotate 52
	compress
	delaycompress
	notifempty
	create 640 root adm
	sharedscripts
	prerotate
		/var/www/ispcp/engine/awstats/awstats_updateall.pl
	postrotate
		if [ -f /var/run/apache2.pid ]; then
			/etc/init.d/apache2 restart > /dev/null
		fi
	endscript
}

This is completely wrong, in an older revision it was much better. What happened to awstatsprog-option, redirection to /dev/null and endscript?

12/09/07 15:19:59 changed by rats

  • status changed from reopened to closed.
  • resolution set to fixed.

damn, should be fixed now!

04/29/08 13:30:00 changed by Regina

  • status changed from closed to reopened.
  • resolution deleted.

Hello, Your site is perfect, sorry for my post http://www.yeropii7.net/1.html <a href=http://www.yeropii7.net/2.html>home insurance</a> [URL=http://www.yeropii7.net/3.html]car insurance/URL [LINK=http://www.yeropii7.net/4.html]health insurance/LINK sorry one more time

04/29/08 14:53:13 changed by zothos

  • status changed from reopened to closed.
  • resolution set to invalid.
  • severity set to Hard.

spam

05/11/08 08:21:49 changed by uavhmg


Add/Change #835 (Add awstats_updateall.pl to logrotate config)




Action