tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "Smith, Lawrie" <Lawrie.Smith () capita ! co ! uk>
To: tru64-unix-managers
Subject: SUMMARY:  too many values in environment
Date: Fri, 28 Dec 2001 14:48:12 +0000	[thread overview]
Message-ID: <102653644221818.tru64-unix-managers.marc@archive.invalid> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="------_=_NextPart_001_01C18FAE.AC6312A0", Size: 15245 bytes --]

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C18FAE.AC6312A0
Content-Type: text/plain;
	charset="iso-8859-1"

Many thanks to Dr Thomas Blinn

Original question with supplement elicited by Dr Thomas Blinn.

I've seen questions about this in the archives but haven't seen an answer
either in the archive or documentation. Anyone?

Apologies for the lack of clarity. Yes, this messages came from the shell
(ksh) as:

cap005 > env | wc -l
too many values in environment
       421

The vast majority of the env vars are set by our development team. They are
migrating an application (RDMS) from
VMS to Tru64 and were looking for an alternative to VMS "logicals". Most of
these variables simply provide 
a specific application path short cut. The reason being that the VMS code
used logicals of the same name
as these env vars and it has reduced the amount of work required in the
migration.

So, yes, the question is, what is the impact? How does this data store
operate FIFO? Stack? Are we going
to loose the ability to reference certain vars or does the problem only
arise when more than a set number are
referenced in one hit? What is the limit? Can it be increased? 

Can you point me to an info source, I have looked but can find nothing in
the documentation. TIA.

Reply from Dr Thomas Blinn

	I wonder if "printenv" elicits the same error message; for the case
you
	cite it should do the same thing, that is, display the current set
of
	environment variables and their values to standard output so you can
	pipe it into "wc -l".  Not that this solves your underlying problem,
	which is too many defined variables.

	It didn't - LS
	cap005 > printenv | wc -l
      	421


	I can't tell whether the message is coming out of the shell (ksh) or
out
	of the "env" utility.  But if I do this command:

		strings `which env` | grep "too many" 

	it finds the string "too many values in environment" so I believe
that
	the message is coming out of "env", not out of the shell.

		It was :-)
	cap005 > strings `which env` | grep "too many"
		too many values in environment

	Being that as it may, there are MANY ways to work around the limit
for
	a specific application.  For instance, if what the application needs
	is file system paths, then pick some directory location and populate
	it with symlinks where each symlink is named with the path to the
file
	that the application needs, e.g.,

		mkdir -p /user/app/app-paths
		cd /user/app/app-paths
		ln -s /user/app/datafiles/file1 FILE1

	and so on, where the value of the symlink is the path to the file.

	In fact, you can put other "logical names" in symlinks this way; in
	general, you can put almost ANYTHING as the value of a symlink, even
	things with embedded slashes; they can either be the path to an
object
	in the file system, or an arbitrary string value.  The
interpretation
	depends on whether you use them to try to access an object in the
file
	system as part of the path to the object (e.g., by opening the
symlink
	as if it were a file), or whether you use the appropriate library
call
	to retrieve the string value of the symlink (just as "ls -l" uses
when
	it displays the value of the symlink).

	For documentation on the limits on environment variables and
arguments
	passed from one program to another (which is what "env" is designed
to
	be used for, to explicitly control what arguments and environment is
	passed to some program), see the "exec" reference page.  It tells
you
	that the combined size of the environment pairs (name and value) and
	the arguments may not exceed a system limit called ARG_MAX:

	  [E2BIG]  The number of bytes used by the new process image's
argument list
	           and environment list is greater than ARG_MAX bytes.

	This is in the "errors" section -- there is an explicit error return
	for the case where you try to exec a program and the combined size
of
	the environment list and argument list is greater than ARG_MAX
bytes.

	This is a POSIX compliance issue -- it can NOT be increased, it's a
	system limit, if it were increased that would violate POSIX
standards
	compliance and possibly break applications throughout the system.

	OpenVMS doesn't have to be POSIX compliant, and OpenVMS logical
names
	are not the exact equivalent of the UNIX process environment
variables.

	Hope this helps.  I believe that for what you are trying to do,
using
	the symlink trick should be the best approach.  There are no limits
of
	practical value to the number of symlinks in a directory, and you
can
	in fact just open the symlink as a file if that's what you really
want,
	just like in OpenVMS.

Tom

Kind regards

Lawrie Smith
Capita Technical Services
West Malling

email:	lawrie.smith@capita.co.uk
Tel:	01732 877266


www.capita.co.uk

Capita Group LTD Tel: +44 (0)8705-234567
********************** N O T I C E ********************************************
The information in this message is confidential. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful.

We do not accept legal responsibility for the contents of this message and whilst any attachments to this message may have been checked for viruses, you should rely on your own virus checker and procedures.

If you contact us by e-mail, we will store your name and address to facilitate communications.

Any statements contained in this message are those of the individual and not the organisation.

*****************************************************************************

------_=_NextPart_001_01C18FAE.AC6312A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>SUMMARY:  too many values in environment </TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">Many thanks to Dr Thomas Blinn</FONT>
</P>

<P><U><FONT SIZE=3D2 FACE=3D"Arial">Original question with supplement =
elicited by Dr Thomas Blinn.</FONT></U>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I've seen questions about this in the =
archives but haven't seen an answer</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">either in the archive or =
documentation. Anyone?</FONT>
</P>

<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">Apologies for the =
lack of clarity. Yes, this messages came from the shell (ksh) =
as:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Fixedsys">cap005 &gt; env | wc -l</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Fixedsys">too many values in =
environment</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Fixedsys">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 421</FONT>
</P>

<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">The vast majority of =
the env vars are set by our development team. They are migrating an =
application (RDMS) from</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">VMS to Tru64 and =
were looking for an alternative to VMS &quot;logicals&quot;. Most of =
these variables simply provide </FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">a specific =
application path short cut. The reason being that the VMS code used =
logicals of the same name</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">as these env vars =
and it has reduced the amount of work required in the migration.</FONT>
</P>

<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">So, yes, the =
question is, what is the impact? How does this data store operate FIFO? =
Stack? Are we going</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">to loose the =
ability to reference certain vars or does the problem only arise when =
more than a set number are</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">referenced in one =
hit? What is the limit? Can it be increased? </FONT>
</P>

<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">Can you point me to =
an info source, I have looked but can find nothing in the =
documentation. TIA.</FONT>
</P>

<P><U><FONT SIZE=3D2 FACE=3D"Arial">Reply from Dr Thomas =
Blinn</FONT></U>
</P>
<UL>
<P><FONT SIZE=3D2 FACE=3D"Arial">I wonder if &quot;printenv&quot; =
elicits the same error message; for the case you</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">cite it should do the same thing, =
that is, display the current set of</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">environment variables and their =
values to standard output so you can</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">pipe it into &quot;wc -l&quot;.&nbsp; =
Not that this solves your underlying problem,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">which is too many defined =
variables.</FONT>
</P>

<P><B><FONT SIZE=3D2 FACE=3D"Arial">It didn't - LS</FONT></B>
</UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Fixedsys">cap005 &gt; printenv | wc -l</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Fixedsys">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp; 421</FONT>
</P>
<BR>
<UL>
<P><FONT SIZE=3D2 FACE=3D"Arial">I can't tell whether the message is =
coming out of the shell (ksh) or out</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">of the &quot;env&quot; utility.&nbsp; =
But if I do this command:</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">strings `which env` | grep &quot;too many&quot; </FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">it finds the string &quot;too many =
values in environment&quot; so I believe that</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">the message is coming out of =
&quot;env&quot;, not out of the shell.</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B> <FONT SIZE=3D2 =
FACE=3D"Arial">It was :-)</FONT></B>
</UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Fixedsys">cap005 &gt; strings `which env` | grep &quot;too =
many&quot;</FONT>
<UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Fixedsys">too many values in environment</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Being that as it may, there are MANY =
ways to work around the limit for</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">a specific application.&nbsp; For =
instance, if what the application needs</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">is file system paths, then pick some =
directory location and populate</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">it with symlinks where each symlink =
is named with the path to the file</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">that the application needs, =
e.g.,</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">mkdir -p /user/app/app-paths</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">cd /user/app/app-paths</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">ln -s /user/app/datafiles/file1 FILE1</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">and so on, where the value of the =
symlink is the path to the file.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">In fact, you can put other =
&quot;logical names&quot; in symlinks this way; in</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">general, you can put almost ANYTHING =
as the value of a symlink, even</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">things with embedded slashes; they =
can either be the path to an object</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">in the file system, or an arbitrary =
string value.&nbsp; The interpretation</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">depends on whether you use them to =
try to access an object in the file</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">system as part of the path to the =
object (e.g., by opening the symlink</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">as if it were a file), or whether you =
use the appropriate library call</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">to retrieve the string value of the =
symlink (just as &quot;ls -l&quot; uses when</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">it displays the value of the =
symlink).</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">For documentation on the limits on =
environment variables and arguments</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">passed from one program to another =
(which is what &quot;env&quot; is designed to</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">be used for, to explicitly control =
what arguments and environment is</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">passed to some program), see the =
&quot;exec&quot; reference page.&nbsp; It tells you</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">that the combined size of the =
environment pairs (name and value) and</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">the arguments may not exceed a system =
limit called ARG_MAX:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; [E2BIG]&nbsp; The number of =
bytes used by the new process image's argument list</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; and environment list is greater than ARG_MAX bytes.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">This is in the &quot;errors&quot; =
section -- there is an explicit error return</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">for the case where you try to exec a =
program and the combined size of</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">the environment list and argument =
list is greater than ARG_MAX bytes.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">This is a POSIX compliance issue -- it =
can NOT be increased, it's a</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">system limit, if it were increased =
that would violate POSIX standards</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">compliance and possibly break =
applications throughout the system.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">OpenVMS doesn't have to be POSIX =
compliant, and OpenVMS logical names</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">are not the exact equivalent of the =
UNIX process environment variables.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hope this helps.&nbsp; I believe that =
for what you are trying to do, using</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">the symlink trick should be the best =
approach.&nbsp; There are no limits of</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">practical value to the number of =
symlinks in a directory, and you can</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">in fact just open the symlink as a =
file if that's what you really want,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">just like in OpenVMS.</FONT>
</P>
</UL>
<P><FONT SIZE=3D2 FACE=3D"Arial">Tom</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Tahoma">Kind regards</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Tahoma">Lawrie Smith</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Tahoma">Capita Technical Services</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Tahoma">West Malling</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Tahoma">email:&nbsp; =
lawrie.smith@capita.co.uk</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Tahoma">Tel:&nbsp;&nbsp;&nbsp; 01732 =
877266</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C18FAE.AC6312A0--

                 reply	other threads:[~2001-12-28 14:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox