now winix can demonize itself

parameter in the config: demonize (default: true)
 


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@669 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-10-24 19:26:54 +00:00
parent 9c34cb5862
commit c6473f20dc
5 changed files with 213 additions and 171 deletions

View File

@@ -68,7 +68,7 @@ int main(int argv, char ** argc)
if( !app.config.ReadConfig(true, false) ) /* errors to stdout, stdout in not closed */
return 2;
if( app.stdout_is_closed )
if( app.stdout_is_closed || app.config.demonize )
app.config.log_stdout = false;
// closing descriptors only at the beginning
@@ -90,6 +90,9 @@ int main(int argv, char ** argc)
app.LogUserGroups();
if( app.config.demonize && !app.Demonize() )
return 4;
// app.config.base_server can be changed (stripped from 'http://' or a last slash)
// it is done when the config is read
log << log3 << "base_server: " << app.config.base_server << logend;