diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-06-09 02:12:41 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-06-09 02:12:41 +0200 |
commit | 1d8b11e0fa656b0ee86177b7cd756f5d55e9b4d5 (patch) | |
tree | 7e27d0668c3c8bcec57d974af2d41ae8ee3f8a1f /src | |
parent | m + fix echo server crash (diff) | |
download | mds-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.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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; } |