From 273799a8af75e7a76285f1e9b83126ba72667f86 Mon Sep 17 00:00:00 2001 From: sersut Date: Thu, 10 Oct 2013 15:20:48 -0700 Subject: Retain the runlock created during daemonization for the lifetime of the process. --- lib/chef/daemon.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/chef/daemon.rb') diff --git a/lib/chef/daemon.rb b/lib/chef/daemon.rb index 1426234645..e5abca29d8 100644 --- a/lib/chef/daemon.rb +++ b/lib/chef/daemon.rb @@ -25,6 +25,7 @@ class Chef class Daemon class << self attr_accessor :name + attr_accessor :runlock # Daemonize the current process, managing pidfiles and process uid/gid # @@ -33,7 +34,7 @@ class Chef # def daemonize(name) @name = name - runlock = RunLock.new(pid_file) + @runlock = RunLock.new(pid_file) if runlock.test # We've acquired the daemon lock. Now daemonize. Chef::Log.info("Daemonizing..") -- cgit v1.2.1