in reply to Wrong ownership of the file

This is just a guess, so '42' may be just as valid of an answer (see How do I post a question effectively?), but are you using a chown call instead of a chmod call?

--MidLifeXis

Replies are listed 'Best First'.
Re^2: Wrong ownership of the file
by ice_ice_ice (Initiate) on Jan 04, 2012 at 20:05 UTC
    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