# File lib_core/rucy/rc_d.rb, line 41 def lock begin File.open(@lock, File::WRONLY | File::CREAT | File::EXCL | File::TRUNC) {|output| output.write($$.to_s + "\n") } rescue Errno::EEXIST pid = read_pid if (@probe.proc_alive? pid) then raise 'running server' else # race condition (^_^;) # don't parallel lock! File.delete(@lock) retry end end nil end