Project

General

Profile

Bug #5257

svccfg setenv: unable to have spaces in environment variable value

Added by Nathan Howard about 6 years ago. Updated almost 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
smf
Start date:
2014-10-23
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

There appears to be no way to use the svccfg setenv command to add environment variables who's value contains a space.

Steps to reproduce:

  • Try to add environment variable which has a space in the value:
    # svccfg -s pkgsrc/tomcat setenv -s CATALINA_OPTS "-Xms512M -Xmx512M" 
    

Expected result:

Adds the CATALINA_OPTS environment variable with value "-Xms512M -Xms512MB"

Actual result:

# svccfg -s pkgsrc/tomcat setenv -s CATALINA_OPTS "-Xms512M -Xmx512M" 
svccfg: Syntax error.

Some people are saying that the correct incarnation of the command is

svccfg -s pkgsrc/tomcat setenv -s CATALINA_OPTS "-Xms512M -Xmx512M" 

However this ends up effectively setting the following:

CATALINA_OPTS="\\"-Xms512M -Xmx512M\\"" 

which is not what we want.

History

#1

Updated by Nathan Howard about 6 years ago

Apologies, seems 'pre' does odd things with backslashes.

The above should read:

Some people are saying that the correct incarnation of the command is

svccfg -s pkgsrc/tomcat setenv -s CATALINA_OPTS \\"-Xms512M -Xmx512M\\"

However this ends up effectively setting the following:

CATALINA_OPTS="\\"-Xms512M -Xmx512M\\""

#2

Updated by Marcel Telka almost 6 years ago

Similar (maybe the same), but definetely related issue is described here:

https://www.mail-archive.com/smf-discuss@mail.opensolaris.org/msg05524.html

Also available in: Atom PDF