Re: [lusca-cache] r14823 committed - This just fixes a developer irritation....

14 views
Skip to first unread message

Adrian Chadd

unread,
Dec 9, 2010, 11:12:42 PM12/9/10
to Roelf Diedericks, lusca...@googlegroups.com
Hiya,

This introduces an irritation to me. :-)

I'm not seeing -any- debug logging on stderr after this patch. If I
comment out the daemon checks, the dbopen works fine and stuff makes
it to cache.log.

Would you please do a little more digging to figure out why this is and fix it?

Thanks,


Adrian


On 5 November 2010 17:36, <codesite...@google.com> wrote:
> Revision: 14823
> Author: roelf.diedericks
> Date: Fri Nov  5 02:35:07 2010
> Log: This just fixes a developer irritation.
>
> When running squid as no-daemon '-N' switch, do not open the cache.log files
> so that we can see lusca's debugging on stdout instead of having to go
> rummage
> about in cache.log
>
>
> http://code.google.com/p/lusca-cache/source/detail?r=14823
>
> Modified:
>  /branches/LUSCA_HEAD/src/main.c
>
> =======================================
> --- /branches/LUSCA_HEAD/src/main.c     Wed Apr 21 07:10:06 2010
> +++ /branches/LUSCA_HEAD/src/main.c     Fri Nov  5 02:35:07 2010
> @@ -430,7 +430,8 @@
>     setUmask(Config.umask);
>     setEffectiveUser();
>     _db_init(Config.debugOptions);
> -    _db_init_log(Config.Log.log);
> +       if (!opt_no_daemon)
> +               _db_init_log(Config.Log.log);
>
>     /* XXX the ipcache/fqdncache config variables need to be set before this
> is called! */
>     ipcache_local_params();
> @@ -580,7 +581,8 @@
>        Config.Port.icp = (u_short) icpPortNumOverride;
>
>     _db_init(Config.debugOptions);
> -    _db_init_log(Config.Log.log);
> +       if (!opt_no_daemon)
> +               _db_init_log(Config.Log.log);
>     fd_open(fileno(debug_log), FD_LOG, Config.Log.log);
>  #if MEM_GEN_TRACE
>     log_trace_init("/tmp/squid.alloc");
>
> --
> You received this message because you are subscribed to the Google Groups
> "lusca-commit" group.
> To post to this group, send email to lusca-...@googlegroups.com.
> To unsubscribe from this group, send email to
> lusca-commit...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/lusca-commit?hl=en.
>
>

Roelf Diedericks

unread,
Dec 12, 2010, 3:56:16 PM12/12/10
to lusca-users
Hmm, this is weird. I see quite a lot of stuff on stdout if I have for
example
"debug_options ALL,9" in my squid.conf and when using the -N switch.

One thing that does not appear to work correctly is the '-X' (Force
full debugging) switch.
I always end up with the debug options from the config file...

Are you getting lost stderr on Linux or BSD ?


On Dec 10, 6:12 am, Adrian Chadd <adrian.ch...@gmail.com> wrote:
> Hiya,
>
> This introduces an irritation to me. :-)
>
> I'm not seeing -any- debug logging on stderr after this patch. If I
> comment out the daemon checks, the dbopen works fine and stuff makes
> it to cache.log.
>
> Would you please do a little more digging to figure out why this is and fix it?
>
> Thanks,
>
> Adrian
>

Roelf Diedericks

unread,
Dec 12, 2010, 4:15:50 PM12/12/10
to lusca-users
Ah, ok. I may have found it.

If I call _db_log_init(NULL) rather than not calling it all I cannot
see how you wouldn't get stderr,
as dbOpenFile has a check for NULL logfile.

May have been compiler settings or something giving me the advantage
over your setup. NULL initialized pointers
or something maybe.

Have committed r14830.

Let me know ...

Roelf Diedericks

unread,
Dec 12, 2010, 4:23:24 PM12/12/10
to lusca-users
14831 is the real fix. :)

That leaves normal cache.log logging working as well.

Adrian Chadd

unread,
Dec 12, 2010, 7:16:41 PM12/12/10
to lusca...@googlegroups.com
Cool, thanks! Let me see if it now works for me.:)

Adrian

On 13 December 2010 05:23, Roelf Diedericks <roelf.di...@gmail.com> wrote:
> 14831 is the real fix.  :)
>
> That leaves normal cache.log logging working as well.
>

> --
> You received this message because you are subscribed to the Google Groups "lusca-users" group.
> To post to this group, send email to lusca...@googlegroups.com.
> To unsubscribe from this group, send email to lusca-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/lusca-users?hl=en.
>
>

Adrian Chadd

unread,
Dec 12, 2010, 11:55:49 PM12/12/10
to lusca...@googlegroups.com
Ok. Now it does as you've intended; it's just now bugging me.

I run squid/lusca in gdb and run with -N so I can trap segfaults,
breakpoints, etc. I still want log files to be written to cache.log so
I can do post-testing diagnoses. How do I do that ? :P

Maybe we should introduce another switch? But just to excuse the
ignorance here - why'd you make this change in the first place? I
don't recall any squid < 2.7 having this behaviour w/ -N.


Adrian

Roelf Diedericks

unread,
Dec 13, 2010, 6:07:23 AM12/13/10
to lusca-users
I do basically exactly what you do, with squid in gdb, it's just an
irritation for me to have to dig thru
logfiles when I hit a segfault. I'd rather just see the stuff on
stderr whilst in GDB.

I guess our irritations are different. When running as a non-daemon I
like to see all output on stderr rather
than in the logfiles.

But *doh* I see that there is already a switch that does what I want "-
d 9".

I'll revert. Apologies for the runabout.


On Dec 13, 6:55 am, Adrian Chadd <adrian.ch...@gmail.com> wrote:
> Ok. Now it does as you've intended; it's just now bugging me.
>
> I run squid/lusca in gdb and run with -N so I can trap segfaults,
> breakpoints, etc. I still want log files to be written to cache.log so
> I can do post-testing diagnoses. How do I do that ? :P
>
> Maybe we should introduce another switch? But just to excuse the
> ignorance here - why'd you make this change in the first place? I
> don't recall any squid < 2.7 having this behaviour w/ -N.
>
> Adrian
>
> On 13 December 2010 08:16, Adrian Chadd <adrian.ch...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Cool, thanks! Let me see if it now works for me.:)
>
> > Adrian
>

Adrian Chadd

unread,
Dec 13, 2010, 7:53:06 PM12/13/10
to lusca...@googlegroups.com
:-) Ithink we need to document that? :)


Adrian

Reply all
Reply to author
Forward
0 new messages