Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Preventing multiple instances

by davido (Cardinal)
on Jun 04, 2021 at 15:44 UTC ( [id://11133520]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Preventing multiple instances
in thread Preventing multiple instances

Good question.

My thought process when I wrote that was that having the process already running wasn't an exceptional event. It might be noteworthy, but not worthy of a non-zero exit code. But that's entirely subjective to the use-case. I had recently been working on something where it was fairly normal behavior for an instance already to be running, and for that to be a perfectly acceptable situation.

So that's really it. A die would be fine too, but would (on a POSIX system) result in an 11 exit code, resource temporarily unavailable. By separating the message from the termination I went the other direction where the exit code is zero, while STDERR still gets a little quip.


Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133520]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found