RE: [CentOS] Any one have a good example...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



>
As long as you don't have multiple scripts starting at approximately
the same time.   I use this same algorithm sometimes but I always use
flock() because otherwise there is a race condition.  Even using
flock() does not remove the race on the creation of the file, though,
which is why if you really want to remove the race condition you make
sure the file pre-existant (via package delivery or something to that
affect).

At least this is how I understand the problem....james
_______________________________________________


Yep. Defintely. If multiple scripts start up at the same time, then that
pid file will get smashed with multiple values. This works nicely if you
are just looking to make a long running script a little more polite.

Mike
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux