lib/bluepill/process.rb in bluepill-0.0.44 vs lib/bluepill/process.rb in bluepill-0.0.45
- old
+ new
@@ -338,10 +338,11 @@
@actual_pid = nil
end
def unlink_pid
File.unlink(pid_file) if pid_file && File.exists?(pid_file)
+ rescue Errno::ENOENT
end
# Internal State Methods
def skip_ticks_for(seconds)
# TODO: should this be addative or longest wins?
@@ -380,13 +381,15 @@
end
def deep_copy
# TODO: This is a kludge. Ideally, process templates
# would be facotries, and not a template object.
- mutex, @event_mutex = @event_mutex, nil
+ mutex, triggers, @event_mutex, @triggers = @event_mutex, @triggers, nil, nil
clone = Marshal.load(Marshal.dump(self))
clone.instance_variable_set("@event_mutex", Monitor.new)
+ clone.instance_variable_set("@triggers", triggers.collect{ |t| t.deep_copy })
@event_mutex = mutex
+ @triggers = triggers
clone
end
def prepare_command(command)
command.to_s.gsub("{{PID}}", actual_pid.to_s)