can't run-all-webalizer.pl from logrotate

Hi,
I tried to run run-all-webalizer.pl as prerotate script from /etc/logrotate.d/apache2, but I get these errors:

Undefined subroutine &virtual_server::has_ftp_chroot called at ./virtual-server-lib.pl line 167.
Compilation failed in require at /usr/share/webmin/virtual-server/run-all-webalizer.pl line 24.
error: error running shared prerotate script for /var/log/apache2

In /etc/logrotate.d/apache2 I added these lines:

prerotate
/usr/sbin/virtualmin run-all-webalizer.pl
endscript

If I run "virtualmin run-all-webalizer.pl" from a terminal as root, or from root's crontab, works perfectly.

Debian 4.0
Virtualmin Pro 3.64-2
webmin-virtual-server-theme 6.5-2

Thanks in advance

Status: 
Closed (fixed)