Skip to content

Commit b1f504e

Browse files
authored
Merge pull request #28 from acornard/disable-on-die-exit-option
Delete on_die=exit option
2 parents 0ff5f34 + 24af72e commit b1f504e

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

gridinit.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ command=gridinit_testcmd /tmp/key0.out 5
7272
# are sent.
7373
enabled=true
7474

75-
# on_die : 'cry' | 'respawn' | 'exit'
75+
# on_die : 'cry' | 'respawn'
7676
# Optional and dangerous directive telling what to do with the whole
7777
# gridinit when the current service dies, whatever the normality of
7878
# the death.

lib/children.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ supervisor_children_enable(const char *key, gboolean enable)
868868

869869
/* We reset the 'last_start_attempt' field. This is necessary
870870
* to explicitely restart services configured with the 'cry'
871-
* or 'exit' value for their 'on_die' parameter */
871+
* value for their 'on_die' parameter */
872872
sd->last_start_attempt = 0;
873873
}
874874

main/gridinit.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
5454
#include "./gridinit_alerts.h"
5555
#include "../lib/gridinit-internals.h"
5656

57-
#define USERFLAG_ONDIE_EXIT 0x00000001
5857
#define USERFLAG_PROCESS_DIED 0x00000002
5958
#define USERFLAG_PROCESS_RESTARTED 0x00000004
6059

@@ -209,13 +208,6 @@ alert_proc_died(void *udata, struct child_info_s *ci)
209208
{
210209
(void) udata;
211210

212-
/* if the user_flags on the process contain the on_die:exit flag,
213-
* then we mark the gridinit to stop */
214-
if (ci->user_flags & USERFLAG_ONDIE_EXIT) {
215-
supervisor_children_enable(ci->key, FALSE);
216-
flag_running = FALSE;
217-
}
218-
219211
if (ci->started)
220212
supervisor_children_set_user_flags(ci->key, USERFLAG_PROCESS_DIED);
221213
}
@@ -1244,16 +1236,12 @@ _cfg_section_service(GKeyFile *kf, const gchar *section, GError **err)
12441236
WARN("Failed to set 'tobestarted/tobestopped' for [%s] : %s", str_key, strerror(errno));
12451237
}
12461238

1247-
/* on_die management. Respawn, cry, or abort */
1239+
/* on_die management. Respawn, cry */
12481240
if (str_ondie) {
12491241
if (0 == g_ascii_strcasecmp(str_ondie, "cry")) {
12501242
if (0 > supervisor_children_set_respawn(str_key, FALSE))
12511243
WARN("Failed to make [%s] respawn : %s", str_key, strerror(errno));
12521244
}
1253-
else if (0 == g_ascii_strcasecmp(str_ondie, "exit")) {
1254-
supervisor_children_set_user_flags(str_key, USERFLAG_ONDIE_EXIT);
1255-
supervisor_children_set_respawn(str_key, FALSE);
1256-
}
12571245
else if (0 == g_ascii_strcasecmp(str_ondie, "respawn"))
12581246
supervisor_children_set_respawn(str_key, TRUE);
12591247
else {

0 commit comments

Comments
 (0)