RMPS: more logging improvements

This commit is contained in:
2019-01-13 14:33:50 +02:00
parent fe354d9f74
commit 2a61e77810
2 changed files with 7 additions and 2 deletions

View File

@@ -75,6 +75,7 @@ static void *servlet(void *args) /* Serve the connection -- threadable */
log(WARNING, "SSL_accept() failed. Reason below:");
log_ssl();
} else {
log(INFO, "Agent [%s] has connected.", agent->ip);
show_certs(agent->ssl);
do {
buf.meta.type = GET_OS;
@@ -96,7 +97,7 @@ static void *servlet(void *args) /* Serve the connection -- threadable */
}
if (SSL_get_shutdown(agent->ssl)
== SSL_RECEIVED_SHUTDOWN)
log(VERBOSE, "Agent [%s] has shutdown.",
log(INFO, "Agent [%s] has shutdown.",
agent->ip);
else {
log(VERBOSE, "Client didn't send data!");

View File

@@ -67,13 +67,17 @@ static void signal_handler(int sig)
log(WARNING, "Received SIGHUP signal. Ignoring...");
break;
case SIGINT:
log(INFO, "Received SIGINT signal.");
log(INFO, "RMPS is shutting down...");
rmps_shutdown();
log(INFO, "RMPS has been stopped properly.");
_exit(EXIT_SUCCESS);
case SIGTERM:
log(INFO, "Received SIGTERM signal.");
log(INFO, "RMPS is shutting down...");
rmps_shutdown();
log(INFO, "RMPS has been stopped properly.");
_exit(EXIT_SUCCESS);
break;
default:
log(WARNING, "Unhandled signal %s", strsignal(sig));
break;