in reply to Re: Wrong ownership of the file
in thread Wrong ownership of the file

Thanks for reply and sorry for not clear question.

You have right, chown made one error, because I received this communicate:

error: chown failed: (sniffer.log.1) at test.pl line 150
Right now I set up the object of Logfile::Rotate like this:
my $log = new Logfile::Rotate( File => 'sniffer.log', + Pre => sub{close($LOG_ +FILE);}, +Post => sub{open( $LOG_FILE, '>', 'sniffer.log');}, + Flock => 'no', + Persist => 'no');

The problem with chown call was solved but unfortunately I have another error:

error: could not truncate sniffer.log: Permission denied at test.pl line 151

I think that this is related to this files wrong ownership:

-rw-r--r-- 1 root root 0 2012-01-04 20:51 sniffer.log -rw-r--r-- 1 200 200 0 2012-01-04 20:51 sniffer.log.1

I tried the same algorithm without packet capture and everything was ok: no errors, files were created with correct ownership