abort pluto or charon if initialization fails

This commit is contained in:
Andreas Steffen
2009-08-06 16:32:52 +02:00
parent dd83c6d490
commit 3646c8a159
10 changed files with 37 additions and 15 deletions
+5
View File
@@ -53,6 +53,11 @@ void starter_charon_sigchild(pid_t pid, int status)
(status == 64) ? "libstrongswan" : "charon");
_stop_requested = 1;
}
else if (status == SS_RC_INITIALIZATION_FAILED)
{
plog("charon has quit: initialization failed");
_stop_requested = 1;
}
if (!_stop_requested)
{
plog("charon has died -- restart scheduled (%dsec)"
+5
View File
@@ -54,6 +54,11 @@ starter_pluto_sigchild(pid_t pid, int status)
(status == 64) ? "libstrongswan" : "pluto");
_stop_requested = 1;
}
else if (status == SS_RC_INITIALIZATION_FAILED)
{
plog("pluto has quit: initialization failed");
_stop_requested = 1;
}
if (!_stop_requested)
{
plog("pluto has died -- restart scheduled (%dsec)"
+2 -2
View File
@@ -103,8 +103,8 @@ static void fsig(int signal)
else if (WIFEXITED(status))
{
exit_status = WEXITSTATUS(status);
if (exit_status == SS_RC_LIBSTRONGSWAN_INTEGRITY ||
exit_status == SS_RC_DAEMON_INTEGRITY)
if (exit_status >= SS_RC_LIBSTRONGSWAN_INTEGRITY &&
exit_status <= SS_RC_INITIALIZATION_FAILED)
{
_action_ = FLAG_ACTION_QUIT;
}