UnixAdminsDiary

Monday, June 05, 2006

Arg list too long on IRIX systems

A common problem: you are running a script or program on your IRIX machine, that automatically generates the command line call for another script or program - but the call fails with the following error message:

bad interpreter: Arg list too long

Ok, the cause is clear - the generated call exceeds the system's max args limit. Luckily, this can be fixed very easily on IRIX systems - as also explained at SGI Techpubs library.

First, lets have a look whats the actual limit. This can be examined using sysconf:

shell> sysconf | grep ARG_MAX
ARG_MAX 20480
...


Well, the actual (IRIX default) limit is about 20k for the max command line lenght, which is definitly not very much. Now we check whats the allowed maximum for the actual kernel. We open /var/sysgen/mtune/kernel with any ascii viewer and search for the definition of ncargs or we just use grep like this:

grep ncargs /var/sysgen/mtune/kernel
* ncargs is max # bytes of arguments passed during an exec(2)
ncargs 20480 5120 262144

There we can see that the legal range for ncargs is from 5120 to 262144, which seems to be the right value for us. IRIXs systune cat set this value during runtime:

systune -b ncargs 262144

After this (without logout, reboot or something else), the new value is active:

shell> sysconf | grep ARG_MAX
ARG_MAX 262144
...

Now our script should have plenty argument space to operate ...

0 Comments:

Post a Comment

<< Home