Samba
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Samba

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 24th, 2008, 06:11 PM
Steve French
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
setting up logging in executables that link to samba libraries

Am having trouble setting up the cifs.upcall program to log to samba
logs (/usr/local/samba33/var/log.*)
Apparently the following is not enough to get debug(0, messages to log.

setup_logging(argv[0], false);
load_case_tables();
reopen_logs();

I did a quick test by checking lp_loaded's value after these lines and
it shows as false. What sets lp_loaded to true? Am I missing an init
step. This runs in the background (launched by keyctl daemon) so
would be nice to be able to log the samba client lib calls it invokes
(wasn't able to get the samba client lib calls to log to syslog either
with the ./configure and smb.conf having "syslog = 10").

Any idea if there is a missing setup call that an executable needs to
do before enabling logging?

--
Thanks,

Steve

Reply With Quote
  #2  
Old July 25th, 2008, 08:11 AM
Andreas Schneider
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
setting up logging in executables that link to samba libraries

Steve French wrote:
Am having trouble setting up the cifs.upcall program to log to samba
logs (/usr/local/samba33/var/log.*)
Apparently the following is not enough to get debug(0, messages to log.

setup_logging(argv[0], false);
load_case_tables();
reopen_logs();



Hi Steve,


I think you have to do the following:


INIT


/* track talloc null_context memory */
talloc_enable_null_tracking();

load_case_tables();
setup_logging(argv[0], false);

/* get_dyn_CNFIGFILE points to the std location. If that fails,
* it silently ignores it and use the internal defaults.
*/
lp_load(get_dyn_CNFIGFILE(), True, False, False, False);

reopen_logs();

FREE


gfree_names();
gfree_loadparm();
gfree_case_tables();
gfree_charcnv();

/* release the talloc null_context memory last */
talloc_disable_null_tracking();

gfree_debugsyms();



-- andreas

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Samba > setting up logging in executables that link to samba libraries


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek