From 16f3b11515fd7d541eef7f9762284cb921c10723 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Fri, 8 Jan 2016 02:32:32 +0900 Subject: [PATCH] :warning: assigned but unused variable - restart, sess_id, pid --- lib/daemons/application_group.rb | 2 +- lib/daemons/daemonize.rb | 4 ++-- lib/daemons/monitor.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/daemons/application_group.rb b/lib/daemons/application_group.rb index acf37e7..ed00e64 100644 --- a/lib/daemons/application_group.rb +++ b/lib/daemons/application_group.rb @@ -69,7 +69,7 @@ def find_applications_by_app_name(app_name) if x && x.chomp! processes = x.split(/\n/).compact processes = processes.delete_if do |p| - pid, name, add = p.split(/\s/) + _pid, name, add = p.split(/\s/) # We want to make sure that the first part of the process name matches # so that app_name matches app_name_22 diff --git a/lib/daemons/daemonize.rb b/lib/daemons/daemonize.rb index a4b02bb..294bbf0 100644 --- a/lib/daemons/daemonize.rb +++ b/lib/daemons/daemonize.rb @@ -58,7 +58,7 @@ def call_as_daemon(block, logfile_name = nil, app_name = nil) rd.close # Detach from the controlling terminal - unless sess_id = Process.setsid + unless Process.setsid fail Daemons.RuntimeException.new('cannot detach from controlling terminal') end @@ -100,7 +100,7 @@ def daemonize(logfile_name = nil, app_name = nil) # Prevent the possibility of acquiring a controlling terminal trap 'SIGHUP', 'IGNORE' - exit if pid = safefork + exit if safefork $0 = app_name if app_name diff --git a/lib/daemons/monitor.rb b/lib/daemons/monitor.rb index 1d8433b..df40b63 100644 --- a/lib/daemons/monitor.rb +++ b/lib/daemons/monitor.rb @@ -46,7 +46,7 @@ def watch(application_group) sleep(1) - Process.detach(fork { a.start(restart = true) }) + Process.detach(fork { a.start(true) }) sleep(5) end