How can i control the same app in two servers?

view story

http://www.unix.com – Hi guys, I need to control that the same app can't run in two servers at the same times. This app is stored in directory, which it's share between these two servers. If one instances is running in one of the servers and someone from the other server execute the same script (star) from the other server, everythind going down and someone will kill me. Please anyone tell/guide me . (HowTos)