Ask a Question related to PERL Modules, Design and Development.
-
onlineviewer #1
Logfile::Rotate error,
Hello All,
I'm trying to use this Log::Rotate module but i am getting an error
messages when i try
to run this script. I dont know enough to know where the problem may
be.
############################
use Logfile::Rotate;
my $log = new Logfile::Rotate( File =>
'/usr/local/apache/logs/error_log',
Count => 7,
Gzip => 'lib',
Post => sub{
open(IN,
"/usr/local/apache/logs/httpd.pid");
kill("HUP", chomp(<IN>)); }
Dir => '/var/log/old',
Flock => 'yes',
Persist => 'yes',
);
# process log file
$log->rotate();
############################
ERROR MESSAGE:
Can't modify <HANDLE> in chomp at log_rotate_script02.pl line 9, near
"<IN>)"
syntax error at log_rotate_script02.pl line 10, near "Dir"
Execution of log_rotate_script02.pl aborted due to compilation errors.
Any advice ?
Thanks,
onlineviewer Guest
-
FMS 2.0.4 play stream end with 404 in logfile
Hello I installed a fms 2.0.4 on a linux box. The Admin panel and the daemon is runnig, i created a test site to connect to the fms, but i am not... -
new module Logfile::Access
I just uploaded my first perl module, Logfile::Access. Makes parsing access logs very easy. ... -
drag model to rotate & resetWorld() error
I have created a shockwave file that builds a toroid, and I want to allow the user to rotate the toroid once it's built, and also to build a new one... -
CCW Rotate and 180 rotate in PS CS are not working properly
I have installed the singel version of Photoshop CS on a G4 under Panther and a newly purchased G5 using Panther. When a bitmap file is created (i.e.... -
Logfile after print
Hello Ng I have a small problem with an Aix Version 4.3 Every time I print a document to a certain printer, a second page is printed out. It... -
Sisyphus #2
Re: Logfile::Rotate error,
"onlineviewer" <lancerset@gmail.com> wrote in message
news:1146713359.482640.51560@j73g2000cwa.googlegro ups.com...Make that:> Hello All,
>
> I'm trying to use this Log::Rotate module but i am getting an error
> messages when i try
> to run this script. I dont know enough to know where the problem may
> be.
>
> ############################
>
> use Logfile::Rotate;
> my $log = new Logfile::Rotate( File =>
> '/usr/local/apache/logs/error_log',
> Count => 7,
> Gzip => 'lib',
> Post => sub{
> open(IN,
> "/usr/local/apache/logs/httpd.pid");
> kill("HUP", chomp(<IN>)); }
> Dir => '/var/log/old',
> Flock => 'yes',
> Persist => 'yes',
> );
>
> # process log file
>
> $log->rotate();
>
> ############################
>
Post => sub{
open(IN,
"/usr/local/apache/logs/httpd.pid");
kill("HUP", chomp(<IN>)); },
(ie add a comma at the end) and I think it will be fine. The way you've
written it there's no separation between the hash entry for 'Post' and the
hash entry for 'Dir'.
Cheers,
Rob
Sisyphus Guest
-
onlineviewer #3
Re: Logfile::Rotate error,
Hello Again,
I tried that out and i am gettting this message still:
Can't modify <HANDLE> in chomp at log_rotate_module02.pl line 9, near
"<IN>)"
Execution of log_rotate_module02.pl aborted due to compilation errors.
onlineviewer Guest
-
onlineviewer #4
Re: Logfile::Rotate error,
I've also tried this script, but no luck..
#####################################
use Logfile::Rotate;
my $log = new Logfile::Rotate( File =>
'/usr/local/apache/logs/error_log',
Count => 7,
Gzip => '/usr//bin/gzip',
Signal => sub {
my $pid = `cat
/usr/local/apache/logs/httpd.pid`;
my @args = ('kill', '-s',
'HUP', $pid );
system(@args);
},
Dir => '/var/log/old'
);
$log->rotate();
#####################################
Error Message:
Signal is a deprecated argument, see Pre/Post at log_rotate_module03.pl
line 12
/usr/bin/kill[8]: 431^J: Arguments must be %job or process ids.
onlineviewer Guest
-
Sisyphus #5
Re: Logfile::Rotate error,
"onlineviewer" <lancerset@gmail.com> wrote in message
news:1146754166.411693.248840@i39g2000cwa.googlegr oups.com...Oh yes - you can't do a 'chomp(<IN>)'. (Sorry, missed that.)> Hello Again,
>
> I tried that out and i am gettting this message still:
>
> Can't modify <HANDLE> in chomp at log_rotate_module02.pl line 9, near
> "<IN>)"
> Execution of log_rotate_module02.pl aborted due to compilation errors.
>
One way is to code it as:
Post => sub{
open(IN, "/usr/local/apache/logs/httpd.pid") or die $!; # check that open
succeeded
my $t = <IN>;
chomp($t);
kill("HUP", $t);
},
I don't use this module, btw, and know nothing about it - I'm just trying to
fix the errors based on the messages being generated. I don't know whether
that's going to make the script do whatever it is you're hoping it will do
:-)
Cheers,
Rob
Sisyphus Guest
-
DJ Stunks #6
Re: Logfile::Rotate error,
Sisyphus wrote:or: chomp( my $t = <IN> );> Oh yes - you can't do a 'chomp(<IN>)'. (Sorry, missed that.)
>
> One way is to code it as:
>
> Post => sub{
> open(IN, "/usr/local/apache/logs/httpd.pid") or die $!; # check that open
> succeeded
> my $t = <IN>;
> chomp($t);
> kill("HUP", $t);
> },
odd though, because he copied the example straight out of the docs...
-jp
DJ Stunks Guest



Reply With Quote

