Roxen.git/server/base_server/roxen.pike:1:
// This file is part of Roxen WebServer.
// Copyright © 1996 - 2001, Roxen IS.
//
// The Roxen WebServer main program.
//
// Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.
// ABS and suicide systems contributed freely by Francesco Chemolli
- constant cvs_version="$Id: roxen.pike,v 1.677 2001/06/26 09:41:40 per Exp $";
+ constant cvs_version="$Id: roxen.pike,v 1.678 2001/06/26 23:18:14 hop Exp $";
// The argument cache. Used by the image cache.
ArgCache argcache;
// Some headerfiles
#define IN_ROXEN
#include <roxen.h>
#include <config.h>
#include <module.h>
#include <variables.h>
#include <stat.h>
#include <timers.h>
// Inherits
inherit "global_variables";
-
+ #ifdef SNMP_AGENT
+ inherit "snmpagent";
+ #endif
inherit "hosts";
inherit "disk_cache";
// inherit "language";
inherit "supports";
inherit "module_support";
inherit "config_userdb";
#ifdef THREADS
// Used when running threaded to find out which thread is the backend thread.
Thread.Thread backend_thread;
Roxen.git/server/base_server/roxen.pike:419:
report_notice("Exiting roxen (spurious signals received).\n");
stop_all_configurations();
destruct(cache);
#ifdef THREADS
stop_handler_threads();
#endif /* THREADS */
};
exit(-1); // Restart.
}
+ #ifdef SNMP_AGENT
+ if(objectp(snmpagent))
+ snmpagent->disable();
+ #endif
+
catch(stop_all_configurations());
destruct(cache);
call_out(really_low_shutdown, 0.1, exit_code);
}
// Perhaps somewhat misnamed, really... This function will close all
// listen ports and then quit. The 'start' script should then start a
// new copy of roxen automatically.
void restart(float|void i, void|int exit_code)
Roxen.git/server/base_server/roxen.pike:3786:
if( c->query( "no_delayed_load" ) )
c->enable_all_modules();
#endif // RUN_SELF_TEST
#ifdef THREADS
start_handler_threads();
backend_thread = this_thread();
name_thread( backend_thread, "Backend" );
#endif /* THREADS */
+ #ifdef SNMP_AGENT
+ //SNMPagent start
+ report_notice("SNMPagent configuration checking ... ");
+ if(query("snmp_agent")) {
+ // enabling SNMP agent
+ snmpagent = SNMPagent();
+ snmpagent->enable();
+ report_notice("enabled.\n");
+
+ } else
+ report_notice("disabled.\n");
+ #endif // SNMP_AGENT
+
// Signals which cause a restart (exitcode != 0)
foreach( ({ "SIGINT", "SIGTERM" }), string sig)
catch( signal(signum(sig), async_sig_start(exit_when_done,0)) );
catch(signal(signum("SIGHUP"),async_sig_start(reload_all_configurations,1)));
// Signals which cause Roxen to dump the thread state
foreach( ({ "SIGQUIT", "SIGUSR1", "SIGUSR2", "SIGTRAP" }), string sig)
catch( signal(signum(sig),async_sig_start(describe_all_threads,-1)));
Roxen.git/server/base_server/roxen.pike:3830: Inside #if undefined(__NT__)
remove_call_out(restart_if_stuck);
break;
#endif
case "suicide_engage":
if (value)
call_out(restart,60*60*24*max(1,query("suicide_timeout")));
else
remove_call_out(restart);
break;
+
+ #ifdef SNMP_AGENT
+ case "snmp_agent":
+ if (value && !snmpagent) {
+ report_notice("SNMPagent enabling ...\n");
+ snmpagent = SNMPagent();
+ snmpagent->enable();
}
-
+ if (!value && objectp(snmpagent)) {
+ report_notice("SNMPagent disabling ...\n");
+ snmpagent->disable();
+ snmpagent = 0;
}
-
+ break;
+ #endif // SNMP_AGENT
-
+ }
+ }
+
int is_ip(string s)
{
return (sscanf(s,"%*d.%*d.%*d.%*d")==4 && s[-1]>47 && s[-1]<58);
}
static string _sprintf( )
{
return "roxen";
}