return;
/* Show condition check message if the job did not actually do anything due to failed condition. */
- if ((t == JOB_START && result == JOB_DONE && !u->condition_result) ||
- (t == JOB_START && result == JOB_SKIPPED)) {
+ if (t == JOB_START && result == JOB_DONE && !u->condition_result) {
log_struct(LOG_INFO,
"MESSAGE=Condition check resulted in %s being skipped.", unit_status_string(u),
"JOB_ID=%" PRIu32, job_id,
unit_notify(UNIT(s), table[old_state], table[state],
(s->reload_result == SERVICE_SUCCESS ? 0 : UNIT_NOTIFY_RELOAD_FAILURE) |
- (s->will_auto_restart ? UNIT_NOTIFY_WILL_AUTO_RESTART : 0) |
- (s->result == SERVICE_SKIP_CONDITION ? UNIT_NOTIFY_SKIP_CONDITION : 0));
+ (s->will_auto_restart ? UNIT_NOTIFY_WILL_AUTO_RESTART : 0));
}
static usec_t service_coldplug_timeout(Service *s) {
} else if (s->control_pid == pid) {
s->control_pid = 0;
- /* ExecCondition= calls that exit with (0, 254] should invoke skip-like behavior instead of failing */
- if (f == SERVICE_FAILURE_EXIT_CODE && s->state == SERVICE_CONDITION && status < 255)
- f = SERVICE_SKIP_CONDITION;
-
if (s->control_command) {
exec_status_exit(&s->control_command->exec_status, &s->exec_context, pid, code, status);
f = SERVICE_SUCCESS;
}
+ /* ExecCondition= calls that exit with (0, 254] should invoke skip-like behavior instead of failing */
+ if (s->state == SERVICE_CONDITION) {
+ if (f == SERVICE_FAILURE_EXIT_CODE && status < 255) {
+ UNIT(s)->condition_result = false;
+ f = SERVICE_SKIP_CONDITION;
+ } else if (f == SERVICE_SUCCESS)
+ UNIT(s)->condition_result = true;
+ }
+
unit_log_process_exit(
u,
"Control process",
},
.finished_start_job = {
[JOB_FAILED] = "Failed to start %s.",
- [JOB_SKIPPED] = "Skipped %s.",
},
.finished_stop_job = {
[JOB_DONE] = "Stopped %s.",
typedef enum UnitNotifyFlags {
UNIT_NOTIFY_RELOAD_FAILURE = 1 << 0,
UNIT_NOTIFY_WILL_AUTO_RESTART = 1 << 1,
- UNIT_NOTIFY_SKIP_CONDITION = 1 << 2,
} UnitNotifyFlags;
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, UnitNotifyFlags flags);