aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-06-09 02:12:41 +0200
committerMattias Andrée <maandree@operamail.com>2014-06-09 02:12:41 +0200
commit1d8b11e0fa656b0ee86177b7cd756f5d55e9b4d5 (patch)
tree7e27d0668c3c8bcec57d974af2d41ae8ee3f8a1f /src
parentm + fix echo server crash (diff)
downloadmds-1d8b11e0fa656b0ee86177b7cd756f5d55e9b4d5.tar.gz
mds-1d8b11e0fa656b0ee86177b7cd756f5d55e9b4d5.tar.bz2
mds-1d8b11e0fa656b0ee86177b7cd756f5d55e9b4d5.tar.xz
kernel: put process name in quotes and print exit status and termination signal on crashed processes
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mds.c b/src/mds.c
index ffe7023..5a204f6 100644
--- a/src/mds.c
+++ b/src/mds.c
@@ -347,20 +347,25 @@ int spawn_and_respawn_server(int fd)
/* Get the current time. (End of child process.) */
time_error |= (monotone(&time_end) < 0);
+ if (WIFEXITED(status))
+ eprintf("`%s' exited with code %i.", master_server, WEXITSTATUS(status));
+ else
+ eprintf("`%s' died by signal %i.", master_server, WTERMSIG(status));
+
/* Do not respawn if we could not read the time. */
if (time_error)
{
perror(*argv);
- eprintf("%s died abnormally, not respawning because we could not read the time.", master_server);
+ eprintf("`%s' died abnormally, not respawning because we could not read the time.", master_server);
goto fail;
}
/* Respawn if the server did not die too fast. */
if (time_end.tv_sec - time_start.tv_sec >= RESPAWN_TIME_LIMIT_SECONDS)
- eprintf("%s died abnormally, respawning.", master_server);
+ eprintf("`%s' died abnormally, respawning.", master_server);
else
{
- eprintf("%s died abnormally, died too fast, not respawning.", master_server);
+ eprintf("`%s' died abnormally, died too fast, not respawning.", master_server);
goto fail;
}