From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: unicorn-public@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0BC00633834; Fri, 26 Jun 2015 23:14:13 +0000 (UTC) Date: Fri, 26 Jun 2015 23:14:12 +0000 From: Eric Wong To: =?utf-8?Q?Br=C3=A1ulio?= Bhavamitra Cc: unicorn-public Subject: Re: Does the the environment is preserved on USR2? Message-ID: <20150626231412.GB10361@dcvr.yhbt.net> References: <20150626223135.GA9040@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150626223135.GA9040@dcvr.yhbt.net> List-Id: Eric Wong wrote: > USR2 should not change environment variables besides UNICORN_FD > and PWD (if working_directory is used). > > On most Linux versions, you can check the initial environment of a > running process by inspecting the environ file for the process: > > tr '\0' '\n' < /proc/$PID/environ > > This may not reflect environment changes after the process is started. Actually, I noticed this doesn't even reflect ENV changes on fork from Ruby (but system("env") displays the correct result from a forked process) using Linux 4.0.6 > However, you can use ENV inside Ruby code to check that. Maybe add a > private Rack endpoint to show ENV.inspect output to your app to check > this... So use ENV from Ruby instead :)