6 |
# |
# |
7 |
# The Meteor daemon |
# The Meteor daemon |
8 |
# |
# |
9 |
|
# Main program should call Meteor::Config::setCommandLineParameters(@ARGV),. |
10 |
|
# Afterwards anybody can access $::CONF{<parameterName>}, where |
11 |
|
# <parameterName> is any valid parameter (except 'Help') listed in the |
12 |
|
# @DEFAULTS array below. |
13 |
|
# |
14 |
############################################################################### |
############################################################################### |
15 |
# |
# |
16 |
# This program is free software; you can redistribute it and/or modify it |
# This program is free software; you can redistribute it and/or modify it |
31 |
# |
# |
32 |
############################################################################### |
############################################################################### |
33 |
|
|
34 |
|
############################################################################### |
35 |
|
# meterod version |
36 |
|
################################################################################ |
37 |
|
|
38 |
|
$::VERSION='1.05.04'; |
39 |
|
$::RELEASE_DATE='not yet released'; |
40 |
|
|
41 |
############################################################################### |
############################################################################### |
42 |
# Configuration |
# Configuration |
69 |
############################################################################### |
############################################################################### |
70 |
|
|
71 |
# |
# |
72 |
|
# Record startup time |
73 |
|
# |
74 |
|
$::STARTUP_TIME=time; |
75 |
|
$::STARTUP_TIME+=0; # avoid warning |
76 |
|
|
77 |
|
# |
78 |
# Program name |
# Program name |
79 |
# |
# |
80 |
$::PGM=$0; |
$::PGM=$0; |
102 |
{ |
{ |
103 |
$0="$::PGM daemon"; |
$0="$::PGM daemon"; |
104 |
|
|
105 |
unless($::CONF{'Debug'}) |
my $facility=$::CONF{'SyslogFacility'} || $Meteor::Syslog::DEFAULT_FACILITY; |
106 |
|
|
107 |
|
unless($::CONF{'Debug'} || $facility eq 'none') |
108 |
{ |
{ |
109 |
# close standard file descriptors |
# close standard file descriptors |
110 |
close(STDIN); |
close(STDIN); |
127 |
} |
} |
128 |
else |
else |
129 |
{ |
{ |
130 |
print "$::PGM PID: $$\n"; |
&::syslog('info',"PID\t%s",$$); |
131 |
} |
} |
132 |
} |
} |
133 |
|
|
181 |
my $rVec=$serverVector; |
my $rVec=$serverVector; |
182 |
my $wVec=''; |
my $wVec=''; |
183 |
my $eVec=''; |
my $eVec=''; |
184 |
|
|
185 |
my $rout; |
my $rout; |
186 |
my $wout; |
my $wout; |
187 |
my $eout; |
my $eout; |
188 |
|
|
189 |
Meteor::Connection->addAllHandleBits(\$rVec,\$wVec,\$eVec); |
Meteor::Connection->addAllHandleBits(\$rVec,\$wVec,\$eVec); |
190 |
|
|
191 |
my $timeout=$MAIN_LOOP_TIMEOUT; |
my $timeout=$MAIN_LOOP_TIMEOUT; |