setting up logging in executables that link to samba libraries

Andreas Schneider anschneider at suse.de
Fri Jul 25 11:03:34 GMT 2008


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_CONFIGFILE points to the std location. If that fails,
  * it silently ignores it and use the internal defaults.
  */
lp_load(get_dyn_CONFIGFILE(), 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


More information about the samba-technical mailing list