- we want "w+" for the pidfile open because it may not exist yet

This commit is contained in:
Pete Fritchman 2009-10-20 21:24:41 +00:00
parent 282d153d11
commit f3ba581fcb

View file

@ -57,7 +57,7 @@ def main(args)
pidfile = nil
if options[:pidfile]
pidfile = File.open(options[:pidfile], "r+")
pidfile = File.open(options[:pidfile], "w+")
gotlock = pidfile.flock(File::LOCK_EX | File::LOCK_NB)
if !gotlock
owner = pidfile.read()