xmlrpc.c
1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <string.h> /* for memset and stuff */
#include <syslog.h> /* for logging */
#include "include/server.h"
#include "include/monitor.h"
#include "include/signalHandling.h"
#include "include/appConfig.h"
#include "include/daemonize.h"
int verbose;
int main(int argc, char *argv[])
{
tServer server;
tAppConfig appConfig = {
0,
0,
MAXPENDING,
DEFAULTPORT,
DEFAULTPATH,
LOGNAMEPATTERN
};
memset(&server, 0, sizeof(server));
handleCmdLine(&appConfig, argc, argv);
verbose = appConfig.verbose;
/* decouple procss from controlling shell and make it session leader */
if (appConfig.doDaemon) {
daemonize();
}
init_signals();
openlog(argv[0], LOG_PID, LOG_USER);
syslogMonitor(LOG_INFO, MON_INFO, "startup", "service started");
serverInit(
&server,
appConfig.port,
appConfig.maxPending,
appConfig.logPath,
appConfig.namePat);
serverRun(&server);
serverShutdown(&server);
return 0;
}