Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exec error

Status
Not open for further replies.

atriyu

Programmer
Jun 24, 2003
2
US
Hello all,

I have a script which makes multiple exec calls while executing. I see that after a while exec returns an error saying arguement list too long. I m thinking it is some memory issue with linux. Has anyone seen this problem before? I would really like to know if theres a fix for this !
 
Why don't you post your code?
The problem would be with tcl not linux most probably.
 
I dont know if looking at the code might help you..The reason is it is happening at more than one place . So I think the reason is more general .
Also as you pointed out maynot be a linux issue since I just saw this error with spawn,

All I was doing was spawn telnet 10.1.1.1 where 1.1.1.1 is reachable ! but it gace me the same arguement list too long error.

What I have here is a daemon which runs and listens for usesr input on a port through gui and then on reading input spawns a telnet to 10.1.1.1 and reboots it. I am wondering The earlier exec error I saw was when I execed the script to reboot the machine. The weird thing is that it doesnt happen everytime. Probably happens once in a day.

An example of the command that failed is

set user [exec whoami]

or set result [exec tclsh reboot.tcl &]

the telnet command above. Maybe this haapens because the program runs for a long time and eventually starts running out of memory . So if there is a memory cleanup command in tcl that could be used it might be helpful!
 
I'm a little confused.

It seems like:
You are using the expect extension in your tcl script
to handle a remote process triggered by the user via
a tk gui.
But then you say that you are using exec commands
to get info and reboot the local machine?

You also mention something about argument lists being
too long with spawn. I've never seen this.

This type of thing works fine.
set cmd "prog -opt 1 every=24hrs -opt -t redflagged -x"
spawn $cmd

Believe me, without a code sample no one is
goign to be able to help you. You have tk, tcl
and expect so far, and that is a complicated mix
to diagnose.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top