starter: Reset action before handling it

Stater will lose update/reload commands when there is a second signal
coming in when the previous is still processed. This can happen more
easily with big configurations.

Closes strongswan/strongswan#101.
This commit is contained in:
Markus Sattler
2018-06-05 10:13:22 +02:00
committed by Tobias Brunner
parent 3a8a9c7029
commit 1331010aa4
+3 -3
View File
@@ -650,6 +650,7 @@ int main (int argc, char **argv)
*/
if (_action_ & FLAG_ACTION_RELOAD)
{
_action_ &= ~FLAG_ACTION_RELOAD;
if (starter_charon_pid())
{
for (conn = cfg->conn_first; conn; conn = conn->next)
@@ -679,7 +680,6 @@ int main (int argc, char **argv)
}
}
}
_action_ &= ~FLAG_ACTION_RELOAD;
}
/*
@@ -687,6 +687,7 @@ int main (int argc, char **argv)
*/
if (_action_ & FLAG_ACTION_UPDATE)
{
_action_ &= ~FLAG_ACTION_UPDATE;
DBG2(DBG_APP, "Reloading config...");
new_cfg = confread_load(config_file);
@@ -767,7 +768,6 @@ int main (int argc, char **argv)
confread_free(new_cfg);
}
}
_action_ &= ~FLAG_ACTION_UPDATE;
last_reload = time_monotonic(NULL);
}
@@ -776,6 +776,7 @@ int main (int argc, char **argv)
*/
if (_action_ & FLAG_ACTION_START_CHARON)
{
_action_ &= ~FLAG_ACTION_START_CHARON;
if (!starter_charon_pid())
{
DBG2(DBG_APP, "Attempting to start %s...", daemon_name);
@@ -786,7 +787,6 @@ int main (int argc, char **argv)
}
starter_stroke_configure(cfg);
}
_action_ &= ~FLAG_ACTION_START_CHARON;
for (ca = cfg->ca_first; ca; ca = ca->next)
{