Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

main.c File Reference

Services' startup and main loop. More...

#include "services.h"
#include "hash.h"
#include "nickserv.h"
#include "memoserv.h"
#include "infoserv.h"
#include "sipc.h"
#include "db.h"
#include "mass.h"
#include "log.h"
#include <getopt.h>

Go to the source code of this file.

Functions

int lockfile (char *)
time_t updateCloneAlerts (time_t)
 Update clone alerts.

void ServicesProgramHelp ()
 Help for services command line.

int main (int argc, char *argv[])
 Startup services, begin the main loop.


Variables

int ipcPort
 Port number for services IPC server to listen on.

int svcOptFork
char myname [255]
 My server name, and my server password.

char mypass [33]
 My server name, and my server password.

char hostname [255]
int port
int server
Service services [NUMSERVS]
database db
SLogfileoperlog
 Services Log handlers.

SLogfilenicklog
 Services Log handlers.

SLogfilechanlog
 Services Log handlers.

FILE * corelog
 Logfile to record system errors/debug information.

u_long totalusers
 Total users online at the moment.

u_long mostusers
 Most users online at a time, num nicks, chans, memos.

u_long mostnicks
 Most users online at a time, num nicks, chans, memos.

u_long mostchans
 Most users online at a time, num nicks, chans, memos.

u_long mostmemos
 Most users online at a time, num nicks, chans, memos.

unsigned long top_akill_stamp
 Highest akill stamp in use.

long startup
 Time of startup, time of -first- startup of services.

long firstup
 Time of startup, time of -first- startup of services.

char * OperServ
 Services nickname constants.

char * NickServ
 Services nickname constants.

char * ChanServ
 Services nickname constants.

char * MemoServ
 Services nickname constants.

char * InfoServ
 Services nickname constants.

char * GameServ
 Services nickname constants.

char coreBuffer [IRCBUF]
 Coredump buffer.

u_int AccessLimit
 Specified limits on user data.

u_int OpLimit
 Specified limits on user data.

u_int AkickLimit
 Specified limits on user data.

u_int ChanLimit
 Specified limits on user data.

u_int NickLimit
 Specified limits on user data.

time_t CTime
 Current time.

time_t nextNsync
 Time of Next database saves.

time_t nextCsync
 Time of Next database saves.

time_t nextMsync
 Time of Next database saves.

IpcType servicesIpc
 Master services IPC object.

int runAsRootOverride = 0


Detailed Description

Services' startup and main loop.

Main entry point for services bootup, handles dispatching startup procedures

Author:
Chip Norkus

Max Byrd

Greg Poma

James Hess

Date:
1996-2001
Id
main.c,v 1.1.1.1 2003/07/04 02:54:29 Mysid Exp

Definition in file main.c.


Function Documentation

int lockfile char *  fname  )  [static]
 

Get an exclusive lock on the file name given. Note that the file is NOT closed, since closing it will release the lock we just obtained, which is not what we want.

Parameters:
fname Name of file to lock
Returns:
-1 on failure, 0 on success

Definition at line 664 of file main.c.

Referenced by main().

time_t updateCloneAlerts time_t  aval  ) 
 

Update clone alerts.

Precondition:
Aval is the UTC calendar time at which the updateCloneAlert procedure began.
Returns:
The time at which the next regular updateCloneAlert procedure should occur.

Definition at line 219 of file clone.c.

References CLONE_ALERT, CLONE_OK, userclonestruct::clones, hostclonestruct::clones, CTime, hostclonestruct::firstUser, hostclonestruct::flags, hostclonestruct::host, HostClone, userclonestruct::next, pending_alert::next, OperServ, pendingAlerts, sSend(), userclonestruct::trigger, hostclonestruct::trigger, userclonestruct::uflags, userclonestruct::user, and UserClone.

Referenced by addClone(), and main().


Variable Documentation

unsigned long top_akill_stamp
 

Highest akill stamp in use.

Todo:
Highest stamp should save to services.totals

Definition at line 102 of file main.c.


Generated at Sat Oct 25 20:56:11 2003 for Services using Doxygen.
Services Copyr. 1996-2001 Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, Dafydd James. All rights reserved See LICENSE for licensing information.