Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^2: Easiest way to protect process from duplication.

by gnosti (Friar)
on Jan 23, 2012 at 05:52 UTC ( #949311=note: print w/replies, xml ) Need Help??

in reply to Re: Easiest way to protect process from duplication.
in thread [Solved]Easiest way to protect process from duplication.

Here's a variation that uses the __DATA__ handle.
use Fcntl qw(LOCK_EX LOCK_NB); die "Another instance is already running" unless flock DATA, LOCK_EX|L +OCK_NB;

Replies are listed 'Best First'.
Re^3: Easiest way to protect process from duplication.
by JavaFan (Canon) on Jan 23, 2012 at 07:47 UTC
    That actually requires a __DATA__ (or __END__) token to be present.
      Thank you too. BTW __END__,__DATA__,etc is there any general name for these tokens, (like "Labeled blocks", "builtins",...)? I'm newbie in perl so I just wanted to read about this stuff.
Re^3: Easiest way to protect process from duplication.
by kazak (Beadle) on Jan 24, 2012 at 13:29 UTC
    Thank you for your post, that is what I really need.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://949311]
[Corion]: marto: Clever! ;)
[Corion]: You can only reach me by pager
[Corion]: Maybe the solution would be to launch a cron job every minute that takes two measurements a minute apart and sends a mail if the usage is below on the first and above threshold on the last measurement
[marto]: that's essentially it :)
[marto]: I think the long term solution would be to have sysadmins that do their job, so I don't have to do everything :P
[marto]: they already have an entire BMC patrol system, which they disabled, because it was sending out spurious messages. So rather than fix the issue, or even find out what it was, they turned it off. No messages, can't be any problems, right?
[Corion]: marto: But having open tickets / incidents increases the pressure on them ;) Of course, likely your contract / SLA specifies an upper limit for the number of incidents :-D
[Corion]: marto: Ow ...
[marto]: Corion They don't get into trouble for the number of tickets, or even breached tickets they have
[marto]: which is a core issue with the client

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2017-01-24 10:14 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (203 votes). Check out past polls.