Hi all,

I compiled ntop-3.3.7 on a Solaris x86 box with Suns version of gcc.
Ntop runs fine until it's run as a daemon.

/usr/local/bin/ntop -ibge0 --user ntop --http-server 80
--use-syslog=local1 --db
-file-path /usr/local/share/ntop -d

Then I receive incomplete or blank pages. The log indicates the following:
Sep 23 19:45:44 mymachine ntop[25281]: [ID 702911 local1.error]
**WARNING** gzflush error -2
(stream error)
Sep 23 19:45:45 mymachine ntop[25282]: [ID 702911 local1.error]   EBADF
during sending of page
to web client

I tried compiling with #undef MAKE_WITH_ZLIB etc. as suggested in the
mailing list, and I was still getting the EBADF errors when running ntop
as a daemon.
I finally looked into the daemon code in ntop.c to see what was
different between the daemon and non deamon modes.
in void detachFromTerminalUnderUnix(int doChdir) I commented out the
following:

/* #if SETVBUF_REVERSED
  setvbuf(stdout, _IOLBF, (char *)NULL, 0);
#else
  setvbuf(stdout, (char *)NULL, _IOLBF, 0);
#endif */

re-compiled and now ntop works as a daemon. I've tried just using the
second instance of setvbuf, as the Solaris man pages indicate, but the
system won't work as a daemon. I'm not sure what's going on, but I'm
happy to get it running.
Another question, if you are using the -L option or --use-syslog, what
would be sent to stdout?
Thanks.
John

_______________________________________________
Ntop mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop

Reply via email to