From: Jamie C. <jca...@we...> - 2002-08-03 09:30:42
|
Yes, that is best , because if you use the backquote operator in perl then all the output from your program will be read into a variable which could potentially get huge. You could also display the output from the program in the browser, with code like : open(OUTOUT, "/usr/local/execute/fire 2>&1 |"); while(<OUTPUT>) { print; } close(OUTPUT); but that would also be a bad idea if lots of output is generated. - Jamie Diego Montalvo wrote: > Jamie, > > exactly, the process does produce alot of output in > the shell. sometimes hours of output. > > So I should use the following command? > system("/usr/local/excute/fire >/dev/null > 2>&1 </dev/null &"); > > > > Diego > > --- Jamie Cameron <jca...@we...> wrote: > >>Support wrote: >> >> >>>Hello, >>> >>>Additional information regarding "running process >>> >>from webmin - >> >>>times-out?" question >>> >>>the process actually only runs for about >>> >>6:55-6:56 minutes then freezes >> >>>until I "kill -9" the process. >>> >> >>Does this process produce a lot of output when you >>run it from the >>shell prompt? >> >> >> >>>the parent process is: >>> >>> >>> > /usr/bin/perl-w/usr/local/lib/webmin/howdy_index/c.cgi > >>.... >> >>>shouldn't it be running under /sbin/init ... >>> >> >>No, because webmin is still waiting for output from >>the >>process as you are running it within backquotes. For >>a long-running >>command, it may be better to put it in the >>background with >>code like system("/usr/local/excute/fire >/dev/null >>2>&1 </dev/null &"); >>assuming you don't want to get the output. >> >> - Jamie >> >> >> >>> >>> >>>Diego >>> >>> >>> >>> >>> >>> ----- Original Message ----- >>> >>> From: Support <mailto:su...@ea...> >>> >>> To: web...@li... >>> <mailto:web...@li...> >>> >>> Sent: Thursday, August 01, 2002 2:43 PM >>> >>> Subject: running process from webmin - >>> >>times-out? >> >>> Hello, >>> >>> I am developing a module, which runs a unix >>> >>program. The progam >> >>> works fine from unix shell, or from Webmin if >>> >>the process is short. >> >>> After about 20 minutes I notice that the >>> >>process is still running, >> >>> but is not doing anything "idle" or frozen, >>> >>and i must kill the >> >>> process. If I leave the computer overnight, I >>> >>come back to " no >> >>> more SWAP space" errors, the computer locked >>> >>and must restart. >> >>> I am using the following command "my >>> $results=`/usr/local/excute/fire`;" >>> >>> >>> >>> what am i doing wrong? >>> >>> >>> >>> thanks, >>> >>> >>> >>> Diego |