<cmdsynopsis>
<command>eventlogadm</command>
+ <arg><option>-s</option></arg>
<arg><option>-d</option></arg>
<arg><option>-h</option></arg>
<arg choice="plain"><option>-o</option>
</cmdsynopsis>
<cmdsynopsis>
<command>eventlogadm</command>
+ <arg><option>-s</option></arg>
<arg><option>-d</option></arg>
<arg><option>-h</option></arg>
<arg choice="plain"><option>-o</option>
</cmdsynopsis>
<cmdsynopsis>
<command>eventlogadm</command>
+ <arg><option>-s</option></arg>
<arg><option>-d</option></arg>
<arg><option>-h</option></arg>
<arg choice="plain"><option>-o</option>
<title>OPTIONS</title>
<variablelist>
+ <varlistentry>
+ <term>
+ <option>-s</option>
+ <replaceable>FILENAME</replaceable>
+ </term>
+ <listitem><para>
+ The <command>-s</command> option causes <command>eventlogadm</command> to load the
+ configuration file given as FILENAME instead of the default one used by Samba.
+ </para></listitem>
+ </varlistentry>
<varlistentry>
<term><option>-d</option></term>
printf( " -o addsource <EventlogName> <sourcename> <msgfileDLLname> \tAdds the specified source & DLL eventlog registry entry\n" );
printf( " -o dump <Eventlog Name> <starting_record>\t\t\t\t\tDump stored eventlog entries on STDOUT\n" );
printf( "\nMiscellaneous options:\n" );
+ printf( " -s <filename>\t\t\t\t\t\t\tUse configuration file <filename>.\n");
printf( " -d\t\t\t\t\t\t\t\tturn debug on\n" );
printf( " -h\t\t\t\t\t\t\t\tdisplay help\n\n" );
}
int i;
elogs = lp_eventlog_list( );
- printf( "Active eventlog names (from smb.conf):\n" );
+ printf( "Active eventlog names:\n" );
printf( "--------------------------------------\n" );
if ( elogs ) {
for ( i = 0; elogs[i]; i++ ) {
{
int opt, rc;
char *exename;
+ char *configfile = NULL;
TALLOC_CTX *frame = talloc_stackframe();
opt_debug = 0; /* todo set this from getopts */
- lp_load(get_dyn_CONFIGFILE(), True, False, False, True);
-
exename = argv[0];
/* default */
#if 0 /* TESTING CODE */
eventlog_add_source( "System", "TestSourceX", "SomeTestPathX" );
#endif
- while ( ( opt = getopt( argc, argv, "dho:" ) ) != EOF ) {
+ while ( ( opt = getopt( argc, argv, "dho:s:" ) ) != EOF ) {
switch ( opt ) {
case 'o':
case 'd':
opt_debug = 1;
break;
+ case 's':
+ configfile = talloc_strdup(frame, optarg);
+ break;
+
}
}
exit( 1 );
}
+ if ( configfile == NULL ) {
+ lp_load(get_dyn_CONFIGFILE(), True, False, False, True);
+ } else if (!lp_load(configfile, True, False, False, True)) {
+ printf("Unable to parse configfile '%s'\n",configfile);
+ exit( 1 );
+ }
+
/* note that the separate command types should call usage if they need to... */
while ( 1 ) {
if ( !StrCaseCmp( opname, "addsource" ) ) {