Doesn't the daemon code just exit if it can't get the lock? For the original use case of run lock, preventing two clients from converging simultaneously, you do want to stack at least one of them, as I discussed in the mailing list. There may be hacks to make the cron use case work now (run chef with --daemon and --once might work), or one could write a simple program/script to check the flock on the run lock file. 



> On Oct 10, 2013, at 2:48 PM, Serdar Sutay <notifications@github.com> wrote:
> 
> In lib/chef/run_lock.rb:
> 
> >        end
> > -      # We grabbed the run lock.  Save the pid.
> > +    end
> > +
> > +    #
> > +    # Waits until acquiring the system-wide lock.
> > +    #
> > +    def wait
> > +      runpid = runlock.read.strip.chomp
> > +      Chef::Log.warn("Chef client #{runpid} is running, will wait for it to finish and then run.")
> > +      runlock.flock(File::LOCK_EX)
> I think in the "stuck chef-client" case we can't do anything at this level. We need to build a self-destruct mechanism into chef-client to suicide if he runs for a long amount of time to overcome it. And that would create other problems.
> 
> If you have a stuck chef-client run for a long amount of time, I think we can assume someone needs to intervene on that node.
> 
> —
> Reply to this email directly or view it on GitHub.