From ad8dca5825a0a194eb2b0aaed4016df5e7c71f70 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 4 Sep 2009 16:13:38 +0200 Subject: abrtd: additional logging on initialization failure Signed-off-by: Denys Vlasenko --- src/Daemon/Daemon.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Daemon/Daemon.cpp') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index db051a91..171edd35 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -595,9 +595,17 @@ int main(int argc, char** argv) int i = 20; /* 2 sec */ while (s_sig_caught == 0 && --i) { - usleep(100 * 1000); + usleep(100 * 1000); } - _exit(s_sig_caught != SIGTERM); /* TERM:ok(0), else:bad(1) */ + if (s_sig_caught == SIGTERM) + { + exit(0); + } + if (s_sig_caught) + { + error_msg_and_die("Failed to start: got sig %d", s_sig_caught); + } + error_msg_and_die("Failed to start: timeout waiting for child"); } /* Child (daemon) continues */ setsid(); /* never fails */ -- cgit