return EXIT_FAILURE;
#ifndef _WIN32
- Log(LogNotice, "cli") << "Notifying umbrella process (PID " << l_UmbrellaPid << ") about the config loading success";
+ Log(LogNotice, "cli")
+ << "Notifying umbrella process (PID " << l_UmbrellaPid << ") about the config loading success";
(void)kill(l_UmbrellaPid, SIGUSR2);
- Log(LogNotice, "cli") << "Waiting for the umbrella process to let us doing the actual work";
+ Log(LogNotice, "cli")
+ << "Waiting for the umbrella process to let us doing the actual work";
while (!l_AllowedToWork.load()) {
Utility::Sleep(0.2);
}
- Log(LogNotice, "cli") << "The umbrella process let us continuing";
+ Log(LogNotice, "cli")
+ << "The umbrella process let us continuing";
#endif /* _WIN32 */
/* restore the previous program state */
*/
static pid_t StartUnixWorker(const std::vector<std::string>& configs)
{
- Log(LogNotice, "cli") << "Spawning seemless worker process doing the actual work";
+ Log(LogNotice, "cli")
+ << "Spawning seemless worker process doing the actual work";
try {
Application::UninitializeBase();
l_CurrentlyStartingUnixWorkerPid.store(pid);
(void)sigprocmask(SIG_UNBLOCK, &l_UnixWorkerSignals, nullptr);
- Log(LogNotice, "cli") << "Spawned worker process (PID " << pid << "), waiting for it to load its config";
+ Log(LogNotice, "cli")
+ << "Spawned worker process (PID " << pid << "), waiting for it to load its config";
// Wait for the newly spawned process to either load its config or fail.
for (;;) {
switch (l_CurrentlyStartingUnixWorkerState.load()) {
case UnixWorkerState::LoadedConfig:
- Log(LogNotice, "cli") << "Worker process successfully loaded its config";
+ Log(LogNotice, "cli")
+ << "Worker process successfully loaded its config";
break;
case UnixWorkerState::Failed:
- Log(LogNotice, "cli") << "Worker process couldn't load its config";
+ Log(LogNotice, "cli")
+ << "Worker process couldn't load its config";
while (waitpid(pid, nullptr, 0) == -1 && errno == EINTR) {
#ifdef HAVE_SYSTEMD
if (!requestedTermination) {
int termSig = l_TermSignal.load();
if (termSig != -1) {
- Log(LogNotice, "cli") << "Got signal " << termSig << ", forwarding to seemless worker (PID " << currentWorker << ")";
+ Log(LogNotice, "cli")
+ << "Got signal " << termSig << ", forwarding to seemless worker (PID " << currentWorker << ")";
(void)kill(currentWorker, termSig);
requestedTermination = true;
}
if (l_RequestedReload.exchange(false)) {
- Log(LogInformation, "Application") << "Got reload command: Starting new instance.";
+ Log(LogInformation, "Application")
+ << "Got reload command: Starting new instance.";
#ifdef HAVE_SYSTEMD
sd_notify(0, "RELOADING=1");
if (nextWorker == -1) {
Log(LogCritical, "Application", "Found error in config: reloading aborted");
} else {
- Log(LogInformation, "Application") << "Reload done, old process shutting down. Child process with PID '" << nextWorker << "' is taking over.";
+ Log(LogInformation, "Application")
+ << "Reload done, old process shutting down. Child process with PID '" << nextWorker << "' is taking over.";
(void)kill(currentWorker, SIGTERM);
#endif /* HAVE_SYSTEMD */
}
- Log(LogNotice, "cli") << "Waited for " << Utility::FormatDuration(Utility::GetTime() - start) << " on old process to exit.";
+ Log(LogNotice, "cli")
+ << "Waited for " << Utility::FormatDuration(Utility::GetTime() - start) << " on old process to exit.";
}
// Old instance shut down, allow the new one to continue working beyond config validation
}
if (l_RequestedReopenLogs.exchange(false)) {
- Log(LogNotice, "cli") << "Got signal " << SIGUSR1 << ", forwarding to seemless worker (PID " << currentWorker << ")";
+ Log(LogNotice, "cli")
+ << "Got signal " << SIGUSR1 << ", forwarding to seemless worker (PID " << currentWorker << ")";
(void)kill(currentWorker, SIGUSR1);
}
{
int status;
if (waitpid(currentWorker, &status, WNOHANG) > 0) {
- Log(LogNotice, "cli") << "Seemless worker (PID " << currentWorker << ") stopped, stopping as well";
+ Log(LogNotice, "cli")
+ << "Seemless worker (PID " << currentWorker << ") stopped, stopping as well";
#ifdef HAVE_SYSTEMD
if (!notifiedTermination) {