Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
2c341cd0
Commit
2c341cd0
authored
21 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
put switch_id and start_daemon earlier
svn:r1188
parent
e2881631
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/or/main.c
+11
-10
11 additions, 10 deletions
src/or/main.c
with
11 additions
and
10 deletions
src/or/main.c
+
11
−
10
View file @
2c341cd0
...
...
@@ -430,6 +430,17 @@ static int init_from_config(int argc, char **argv) {
return
-
1
;
}
close_logs
();
/* we'll close, then open with correct loglevel if necessary */
if
(
options
.
User
||
options
.
Group
)
{
if
(
switch_id
(
options
.
User
,
options
.
Group
)
!=
0
)
{
return
-
1
;
}
}
if
(
options
.
RunAsDaemon
)
{
start_daemon
(
options
.
DataDirectory
);
}
if
(
!
options
.
LogFile
&&
!
options
.
RunAsDaemon
)
add_stream_log
(
options
.
loglevel
,
"<stdout>"
,
stdout
);
if
(
options
.
LogFile
)
{
...
...
@@ -450,12 +461,6 @@ static int init_from_config(int argc, char **argv) {
global_read_bucket
=
options
.
BandwidthBurst
;
/* start it at max traffic */
stats_prev_global_read_bucket
=
global_read_bucket
;
if
(
options
.
User
||
options
.
Group
)
{
if
(
switch_id
(
options
.
User
,
options
.
Group
)
!=
0
)
{
return
-
1
;
}
}
if
(
options
.
RunAsDaemon
)
{
/* XXXX Can we delay this any more? */
finish_daemon
();
...
...
@@ -680,10 +685,6 @@ int tor_main(int argc, char *argv[]) {
log_fn
(
LOG_WARN
,
"You are running Tor as root. You don't need to, and you probably shouldn't."
);
#endif
if
(
options
.
RunAsDaemon
)
{
start_daemon
(
options
.
DataDirectory
);
}
if
(
options
.
ORPort
)
{
/* only spawn dns handlers if we're a router */
dns_init
();
/* initialize the dns resolve tree, and spawn workers */
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment