Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I did not intentionally lock the file. Rather I only add the 'flock' calls after I got this error after adding add'l code to my logfile rotate sub.

I also told logfile rotate Flock => no, but that does not rid of my error.

Here is my logfile rotate code:
sub _logroll($;$) { my $gzip; eval qq(use Compress::Zlib); if ($@) { $gzip = q(/usr/bin/gzip); } else { $gzip = q(lib); } if ( scalar @_ == 1 ) { my $roll1 = @_; my $rollog1 = new Logfile::Rotate( File => $roll1, Count => 15, Dir => $dir, Gzip => $gzip, Flock => 'no', Persist => 'yes' ); $rollog1->rotate(); } elsif ( scalar @_ == 2 ) { my ($roll1, $roll2) = @_; my $rollog2 = new Logfile::Rotate( File => $roll1, Count => 15, Dir => $dir, Gzip => $gzip, Flock => 'no', Persist => 'yes' ); my $rollog2a = new Logfile::Rotate( File => $roll2, Count => 15, Dir => $dir, Gzip => $gzip, Flock => 'no', Persist => 'yes' ); $_->rotate() for ($rollog2, $rollog2a); } }
later in my code I am '>>' to this same file from a system command called mksysb, so that looks like:

 system ("mksysb /dev/$rmt -A -e -m -p -X >> $mksysblog 2>&1");


In reply to Re^4: file lock error by dbs
in thread file lock error by dbs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2021-09-20 02:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?