From 68932f8d85e43c3e4d7a78315d7c2f1a7854906e Mon Sep 17 00:00:00 2001 From: Luke Francl Date: Wed, 3 Feb 2016 10:32:43 -0800 Subject: [PATCH] Remove null byte from proctitle Null bytes cause problems with NewRelic RPM: ERROR : Failed to harvest profile_data data, resetting. Error: ERROR : ArgumentError: string contains null byte This happens because File.basename raises an exception when the string contains a null byte. According to @ageweke in 32791ce1531a8cf9f533254204694915394fecba using a null byte is no longer necessary. I have not found any examples online that use the null byte. --- lib/loops/commands/monitor_command.rb | 2 +- lib/loops/commands/start_command.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/loops/commands/monitor_command.rb b/lib/loops/commands/monitor_command.rb index 4b76593..0b2ecc7 100644 --- a/lib/loops/commands/monitor_command.rb +++ b/lib/loops/commands/monitor_command.rb @@ -4,7 +4,7 @@ def execute Loops.logger.write_to_console = true # Set process name - $0 = "loops monitor: #{options[:args].join(' ') rescue 'all'}\0" + $0 = "loops monitor: #{options[:args].join(' ') rescue 'all'}" # Start loops and let the monitor process take over puts "Starting loops in monitor mode..." diff --git a/lib/loops/commands/start_command.rb b/lib/loops/commands/start_command.rb index 9214e54..b7b610d 100644 --- a/lib/loops/commands/start_command.rb +++ b/lib/loops/commands/start_command.rb @@ -8,7 +8,7 @@ def execute # Daemonization if options[:daemonize] - app_name = "loops monitor: #{options[:args].join(' ') rescue 'all'}\0" + app_name = "loops monitor: #{options[:args].join(' ') rescue 'all'}" Loops::Daemonize.daemonize(app_name) end