From f189ab18de69d3dee81117d7925fb370cd038f0f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 28 Oct 2014 01:49:07 +0100 Subject: job: optionally, when a job timeout is hit, also execute a failure action --- src/core/unit.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/unit.c') diff --git a/src/core/unit.c b/src/core/unit.c index e40e6f2068..afb760d4a3 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -520,6 +520,8 @@ void unit_free(Unit *u) { strv_free(u->dropin_paths); free(u->instance); + free(u->job_timeout_reboot_arg); + set_free_free(u->names); unit_unwatch_all_pids(u); @@ -921,6 +923,12 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { if (u->job_timeout > 0) fprintf(f, "%s\tJob Timeout: %s\n", prefix, format_timespan(timespan, sizeof(timespan), u->job_timeout, 0)); + if (u->job_timeout_action != FAILURE_ACTION_NONE) + fprintf(f, "%s\tJob Timeout Action: %s\n", prefix, failure_action_to_string(u->job_timeout_action)); + + if (u->job_timeout_reboot_arg) + fprintf(f, "%s\tJob Timeout Reboot Argument: %s\n", prefix, u->job_timeout_reboot_arg); + condition_dump_list(u->conditions, f, prefix); if (dual_timestamp_is_set(&u->condition_timestamp)) -- cgit v1.2.3-54-g00ecf