MT#55831 Fix sems and sems-pbx to write pid file when running with -E option

- now pid file written with -E as well
(real ticket number: TT#34704)

Change-Id: I21e7f6b71241871cdf3cd1df6d00dfce5bc7c3bd
mr11.2.1
Roman Romanchenko 3 years ago committed by Donat Zenichev
parent d45dcf1ecf
commit a532a09507

@ -207,11 +207,11 @@ static bool apply_args(std::map<char,string>& args)
AmConfig::PlugInPath = it->second;
break;
#ifndef DISABLE_DAEMON_MODE
case 'P':
AmConfig::DaemonPidFile = it->second;
break;
#ifndef DISABLE_DAEMON_MODE
case 'u':
AmConfig::DaemonUid = it->second;
break;
@ -535,10 +535,6 @@ int main(int argc, char* argv[])
DBG("I'm out. pid: %d", main_pid);
return 0;
}
if(write_pid_file()<0) {
goto error;
}
#ifdef PROPAGATE_COREDUMP_SETTINGS
if (have_limit) {
@ -566,6 +562,10 @@ int main(int argc, char* argv[])
};
}
if(write_pid_file()<0) {
goto error;
}
#endif /* DISABLE_DAEMON_MODE */
main_pid = getpid();
@ -661,10 +661,9 @@ int main(int argc, char* argv[])
async_file_writer::instance()->stop();
async_file_writer::instance()->join();
unlink(AmConfig::DaemonPidFile.c_str());
#ifndef DISABLE_DAEMON_MODE
if (AmConfig::DaemonMode) {
unlink(AmConfig::DaemonPidFile.c_str());
}
if(fd[1]){
main_pid = -1;
DBG("send -1 to parent\n");

Loading…
Cancel
Save