mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[11520] Fixed service/daemon calls order. Mixed wrongly in my prev. related fix. :/
Provide more information at windows service (un)install errors. Note: by some reasons i have sometime problems with start windows service using '-s run' command but it start fine by manual from services control applet. Maybe related to used by me win7 x64
This commit is contained in:
parent
b46237b643
commit
40fb57e461
4 changed files with 140 additions and 119 deletions
|
|
@ -137,26 +137,7 @@ extern int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef WIN32 // posix daemon commands need apply before config read
|
||||
switch (serviceDaemonMode)
|
||||
{
|
||||
case 'r':
|
||||
startDaemon();
|
||||
break;
|
||||
case 's':
|
||||
stopDaemon();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!sConfig.SetSource(cfg_file))
|
||||
{
|
||||
sLog.outError("Could not find configuration file %s.", cfg_file);
|
||||
Log::WaitBeforeContinueIfNeed();
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef WIN32 // windows service command need execute after config read
|
||||
#ifdef WIN32 // windows service command need execute before config read
|
||||
switch (serviceDaemonMode)
|
||||
{
|
||||
case 'i':
|
||||
|
|
@ -173,6 +154,25 @@ extern int main(int argc, char **argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (!sConfig.SetSource(cfg_file))
|
||||
{
|
||||
sLog.outError("Could not find configuration file %s.", cfg_file);
|
||||
Log::WaitBeforeContinueIfNeed();
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef WIN32 // posix daemon commands need apply after config read
|
||||
switch (serviceDaemonMode)
|
||||
{
|
||||
case 'r':
|
||||
startDaemon();
|
||||
break;
|
||||
case 's':
|
||||
stopDaemon();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
sLog.outString( "%s [world-daemon]", _FULLVERSION(REVISION_DATE,REVISION_TIME,REVISION_NR,REVISION_ID) );
|
||||
sLog.outString( "<Ctrl-C> to stop.\n\n" );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue