X-Git-Url: http://git.code-monkey.de/?p=umurmur.git;a=blobdiff_plain;f=src%2Fmain.c;h=c74d9646bd71f168ee29627019a76da272ca61ba;hp=bc913395f8b56e784709aac25ed9839ca1820f73;hb=ec643e91b6f4e22c56d8ab7c89a681f84931af91;hpb=a80a3363723e4f8c35acf63274332e20c35616ce diff --git a/src/main.c b/src/main.c index bc91339..c74d964 100644 --- a/src/main.c +++ b/src/main.c @@ -322,7 +322,6 @@ int main(int argc, char **argv) Log_init(false); if (pidfile != NULL) lockfile(pidfile); - #ifdef POSIX_PRIORITY_SCHEDULING /* Set the scheduling policy, has to be called after daemonizing * but before we drop privileges */ @@ -330,12 +329,6 @@ int main(int argc, char **argv) setscheduler(); #endif - switch_user(); - - /* Reopen log file. If user switch results in access denied, we catch - * it early. - */ - Log_reset(); } else Log_init(true); @@ -376,6 +369,16 @@ int main(int argc, char **argv) Sharedmemory_init( bindport, bindport6 ); #endif + if(!nodaemon) { + /* SSL and scheduling is setup, we can drop privileges now */ + switch_user(); + + /* Reopen log file. If user switch results in access denied, we catch + * it early. + */ + Log_reset(); + } + Server_run(); #ifdef USE_SHAREDMEMORY_API