Rundeck: Missing system environment variables on local execution

Created on 16 Jun 2017  路  4Comments  路  Source: rundeck/rundeck

Issue type: Bug report/Enhancement Request

My Rundeck detail

  • Rundeck version: 2.6.11
  • install type: launcher
  • OS Name/version: Windows 2012 R2
  • DB Type/version: Microsoft SQL Server

Expected Behavior
A script interpreter should inherit the system environment variables.

Actual Behavior
All the system environment varibles including PATH is missing.

How to reproduce Behavior
Create a job with a inline script. In the script use the single command "set". The command set displays all environment variables from the command script interpreter cmd.exe. Assign the Rundeck server (local node) for executing the job.

stale

All 4 comments

This is still an issue. I had to write a script to copy all env variables into framework properties before startup.

I have a patch for Rundeck 2.6.11 which is working. I'm upgrading this instance to 2.10.6 and can add a pull request for the patch for the latest version.

The runLocalCommand function in the ScriptExecUtil.java source file uses the legacy exec function in the class java.lang.Runtime. According to the Java 8 documentation, the new ProcessBuilder is preferred for starting processes with a modified environment. https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#exec-java.lang.String:A-java.lang.String:A-java.io.File-

In an effort to focus on bugs and issues that impact currently supported versions of Rundeck, we have elected to notify GitHub issue creators if their issue is classified as stale and close the issue. An issue is identified as stale when there have been no new comments, responses or other activity within the last 12 months. If a closed issue is still present please feel free to open a new Issue against the current version and we will review it. If you are an enterprise customer, please contact your Rundeck Support to assist in your request.
Thank you, The Rundeck Team

Was this page helpful?
0 / 5 - 0 ratings