Bug #5257
opensvccfg setenv: unable to have spaces in environment variable value
0%
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.
Updated by Nathan Howard over 7 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\\""
Updated by Marcel Telka over 7 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