[ 
https://issues.apache.org/jira/browse/STORM-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571768#comment-14571768
 ] 

ASF GitHub Bot commented on STORM-160:
--------------------------------------

GitHub user bourneagain opened a pull request:

    https://github.com/apache/storm/pull/575

    STORM-160 Allow ShellBolt to set env vars (particularly PATH)

    Support to allow ShellBolt to set environment variables
    Example :
    WordCountTopology.java
builder.setBolt("split", (IRichBolt) new 
SplitSentence().setEnv(envMap) ,  8).shuffleGrouping("spout");
    
    where envMap is a map of environment variables to be exported.
    
    Map<String, String> envMap = new HashMap<>();

    envMap.put("PATH","/usr/local"); // append to PATH variable

    envMap.put("HOME", "/usr/local"); // override HOME variable
    
    NOTE: PATH variable is appended by default while others are overridden.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bourneagain/storm STORM-160

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/storm/pull/575.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #575
    
----
commit 80850ca65c257e7ca68dba4363ef745268c80a1b
Author: Shyam Rajendran <[email protected]>
Date:   2015-06-03T22:21:32Z

    STORM-160 Allow ShellBolt to set env vars (particularly PATH)
    
    Support to allow ShellBolt to set environment variables
    Example :
    WordCountTopology.java
builder.setBolt("split", (IRichBolt) new 
SplitSentence().setEnv(envMap) ,  8).shuffleGrouping("spout");
    
    where envMap is a map of environment variables to be exported.
    
    Map<String, String> envMap = new HashMap<>();

    envMap.put("PATH","/usr/local"); // append to PATH variable

    envMap.put("HOME", "/usr/local"); // override HOME variable
    
    NOTE: PATH variable is appended by default while others are overridden.

----


> Allow ShellBolt to set env vars (particularly PATH)
> ---------------------------------------------------
>
>                 Key: STORM-160
>                 URL: https://issues.apache.org/jira/browse/STORM-160
>             Project: Apache Storm
>          Issue Type: New Feature
>            Reporter: James Xu
>            Priority: Minor
>              Labels: newbie
>
> https://github.com/nathanmarz/storm/issues/32
> While trying to implement a multilang based bolt, I discovered that binaries 
> outside of /usr/bin, /usr/sbin, and /sbin, are not found despite being 
> installed in say, /usr/local/bin.
> Is there a way to specify a PATH variable so when storm creates the sub 
> shell, these binaries can be located by name? If not, can we get one added?
> ----------
> nathanmarz: This is a good idea. For the meantime, does using the full path 
> of the binary (e.g., /usr/local/bin/python) work around this issue?
> ----------
> dinedal: That works for processes that don't require any other environment 
> variables.
> Also, in cases where developers have multiple versions of a program (say, 
> RVM) and the production servers have another one installed on the system, it 
> means changing code for deploying the topology.
> ----------
> nicoo: +1
> To work around this issue you can start your multilang bolt from a bash 
> script that set all needed env vars.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to