From dd0ab6cf2f81e87ad0c02b3ac9b2fffea50acbd6 Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Tue, 17 May 2016 11:19:57 -0700 Subject: [PATCH] Suppress "No such file or directory" output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The full message is “cat: /proc/1/cgroup: No such file or directory”. --- lib/active_elastic_job/rack/sqs_message_consumer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_elastic_job/rack/sqs_message_consumer.rb b/lib/active_elastic_job/rack/sqs_message_consumer.rb index 95d2b7b..89757d8 100644 --- a/lib/active_elastic_job/rack/sqs_message_consumer.rb +++ b/lib/active_elastic_job/rack/sqs_message_consumer.rb @@ -19,7 +19,7 @@ class SqsMessageConsumer CONTENT_TYPE = 'application/json'.freeze CONTENT_TYPE_HEADER_NAME = 'Content-Type'.freeze OK_RESPONSE_CODE = '200'.freeze - INSIDE_DOCKER_CONTAINER = `cat /proc/1/cgroup` =~ /docker/ + INSIDE_DOCKER_CONTAINER = `[ -f /proc/1/cgroup ] && cat /proc/1/cgroup` =~ /docker/ DOCKER_HOST_IP = "172.17.0.1".freeze def initialize(app) #:nodoc: