• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

Points for AHOFFMAN

Points for help with question.
0
kipper7
Asked:
kipper7
  • 5
  • 4
  • 3
1 Solution
 
ahoffmannCommented:
ok, lets continue. I'll try to earn these points ;-)
-------

IIRC the script seems to make trouble when called from apache only. So try following:

  1. login as that user which is used to run apache's httpd
     start the script as follows:  /full/path/to/script
     check if it realy produces what you expect

  2. (if 1. succeded)
     modify the script as follows (please post result then):
     $|=1; # flush output (place this before very first print statement)
     print "<BR>Row:$rowcount<BR>"; $rowcount++; # place this inside the foreach where you process @users
0
 
kipper7Author Commented:
Thanks
In that case I will bump up the pts :-)
0
 
kipper7Author Commented:
< . login as that user which is used to run apache's httpd
    start the script as follows:  /full/path/to/script
    check if it realy produces what you expect
>

did that and it works fine (from command line).

< modify the script as follows (please post result then):
    $|=1; # flush output (place this before very first print statement)
    print "<BR>Row:$rowcount<BR>"; $rowcount++; # place this inside the foreach where you process @users >

already tried this (from apache faq), did not work. in fact the addition of the $|=1; no matter where I put it results in no ouptut( from browser). from command line, stil works fine.


0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
ahoffmannCommented:
# have adapted your method of identing reply strings :-)

< did that and it works fine (from command line). >
fine.

< .. $|=1; ... id not work .. >
so I assume that you get no result at all.
This points to my very first comment, you remember?
     "script did not return within server timeout"

In this case we need to have a look into th eworld of debugging inter-process communication ...
Please modify your script in that way that you open a debug/log file, then write each mesage printed on STDOUT to this file too, something like:

     open(F,">/tmp/cgi.log") or print "open cgi.log failed";
     print F "Start logging here at date";

then add a "print F ..." statement in your foreach loop

I'm shure you test this from command line first, as usual ;-)
0
 
samriCommented:
I thought that this is suppose to be a "here I am", "Accept Comment as Answer" and go home with the pts".  Just kidding guys.


You can try to use mod_cgi
http://httpd.apache.org/docs/mod/mod_cgi.html

* I tried, and it never worked! According to the docs, it should work.

cheers.
0
 
samriCommented:
kipper,

The scripts works fine, the only difference is originally userid:apache has /bin/false as shell, I just changed it to /bin/sh

OS: rh7.2, apache 1.3.20


0
 
ahoffmannCommented:
< comment by samri
  perhaps maybe some information in your passwd file that break the <table> tag.  Remember that some properties
                           like homedir, or shell do contain "/", which might have conflicted the HTML tag.
>

I also thought of a problem here, for example if a user is named ROW or TABLE, 'cause of:
     print <<ROW
unusual, but worth a check.
0
 
samriCommented:
perhaps you could try to revise the code to instead of using

print TABLE;
.
.
TABLE

to
print "<table>\n";
print "<tr>..
.
.
print "</table>\n";

This might reduce the possibilities as commented by ahoffman.
0
 
kipper7Author Commented:
OK
Have already tried inserting debugging print statments and creating log files. the log files show no problems. the problem is only when trying to display all the data at the browser (thru apache).

the ideas about the table tags are good, but remember this worked fine a few days ago, which leads me further to believe that it is a system problem  or i need to reinstall apache. gonna wait for the next reboot and see what happens. in the meantime I made a plain vanilla script that uses no HTML formatting, so the users can at least get the information they need, not pretty but gets the job done.

Thanks again
0
 
kipper7Author Commented:
Here is something interesting. If I restart apache, and run the script from the browser it works fine ..ONCE !!
as soon as me or a user tries to run it again, it craps out at the 40th row again !!!

Wierd !!
0
 
ahoffmannCommented:
sounds like a caching problem.

< .. he log files show no problems. >
does this mean that all rows are in the logfile?

BTW, THANKS for grading.
0
 
kipper7Author Commented:
upgraded to apache 2.0.35 and now works fine !!!
Go figure !
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now