chiark
/
gitweb
/
~ianmdlvl
/
secnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mtest/t-userv: Test that output conf file is correct
[secnet.git]
/
secnet.c
diff --git
a/secnet.c
b/secnet.c
index c14a8354a16791764b004857692b5d6486f63152..2ebcddc1ae94491bbf5ad90edb1f12e3a84049dd 100644
(file)
--- a/
secnet.c
+++ b/
secnet.c
@@
-187,11
+187,9
@@
static void parse_options(int argc, char **argv)
static void setup(dict_t *config)
{
list_t *l;
static void setup(dict_t *config)
{
list_t *l;
- item_t *site;
dict_t *system;
struct passwd *pw;
struct cloc loc;
dict_t *system;
struct passwd *pw;
struct cloc loc;
- int i;
l=dict_lookup(config,"system");
l=dict_lookup(config,"system");
@@
-226,6
+224,12
@@
static void setup(dict_t *config)
"that secnet retain root privileges while running.",
require_root_privileges_explanation);
}
"that secnet retain root privileges while running.",
require_root_privileges_explanation);
}
+}
+
+static void start_sites(dict_t *config) {
+ int i;
+ list_t *l;
+ item_t *site;
/* Go along site list, starting sites */
l=dict_lookup(config,sites_key);
/* Go along site list, starting sites */
l=dict_lookup(config,sites_key);
@@
-243,7
+247,7
@@
static void setup(dict_t *config)
cfgfatal(site->loc,"system","non-site closure in site list");
}
s=site->data.closure->interface;
cfgfatal(site->loc,"system","non-site closure in site list");
}
s=site->data.closure->interface;
- s->
control(s->st,True
);
+ s->
startup(s->st
);
}
}
}
}
}
}
@@
-325,8
+329,6
@@
static void run(void)
struct pollfd *fds=0;
int allocdfds=0, shortfall=0;
struct pollfd *fds=0;
int allocdfds=0, shortfall=0;
- Message(M_NOTICE,"%s [%d]: starting\n",version,secnet_pid);
-
do {
if (gettimeofday(&tv_now_global, NULL)!=0) {
fatal_perror("main loop: gettimeofday");
do {
if (gettimeofday(&tv_now_global, NULL)!=0) {
fatal_perror("main loop: gettimeofday");
@@
-493,6
+495,7
@@
int main(int argc, char **argv)
{
dict_t *config;
{
dict_t *config;
+ log_early_init();
phase_hooks_init();
enter_phase(PHASE_GETOPTS);
phase_hooks_init();
enter_phase(PHASE_GETOPTS);
@@
-503,6
+506,7
@@
int main(int argc, char **argv)
enter_phase(PHASE_SETUP);
setup(config);
enter_phase(PHASE_SETUP);
setup(config);
+ start_sites(config);
if (just_check_config) {
Message(M_INFO,"configuration file check complete\n");
if (just_check_config) {
Message(M_INFO,"configuration file check complete\n");
@@
-511,6
+515,7
@@
int main(int argc, char **argv)
enter_phase(PHASE_DAEMONIZE);
become_daemon();
enter_phase(PHASE_DAEMONIZE);
become_daemon();
+ Message(M_NOTICE,"%s [%d]: starting\n",version,secnet_pid);
enter_phase(PHASE_GETRESOURCES);
/* Appropriate phase hooks will have been run */
enter_phase(PHASE_GETRESOURCES);
/* Appropriate phase hooks will have been run */