Emit a ALERT_SHUTDOWN_SIGNAL before shutting down the daemon

This commit is contained in:
Martin Willi
2009-09-22 17:00:00 +02:00
parent a28334720c
commit b262680175
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -133,6 +133,8 @@ enum level_t {
enum alert_t {
/* a RADIUS server did not respond, no additional arguments */
ALERT_RADIUS_NOT_RESPONDING,
/* a shutdown signal has been received, argument is a int with the signal */
ALERT_SHUTDOWN_SIGNAL,
};
/**
+2
View File
@@ -145,11 +145,13 @@ static void run(private_daemon_t *this)
case SIGINT:
{
DBG1(DBG_DMN, "signal of type SIGINT received. Shutting down");
charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
return;
}
case SIGTERM:
{
DBG1(DBG_DMN, "signal of type SIGTERM received. Shutting down");
charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
return;
}
default: