X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Funit.h;h=081ab18f10289fd2b74dc2e9dc97e8ed959ddfcb;hp=43ab4d1045de148a8e86949cb8d99476326b6e75;hb=db2cb23b5b179707000d28a11efb3d888d06ee80;hpb=7c52a17b1a31eedd40093a4fbb460cf492087d9b diff --git a/src/core/unit.h b/src/core/unit.h index 43ab4d104..081ab18f1 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -41,6 +41,7 @@ typedef struct UnitStatusMessageFormats UnitStatusMessageFormats; #include "condition.h" #include "install.h" #include "unit-name.h" +#include "failure-action.h" enum UnitActiveState { UNIT_ACTIVE, @@ -53,6 +54,12 @@ enum UnitActiveState { _UNIT_ACTIVE_STATE_INVALID = -1 }; +typedef enum KillOperation { + KILL_TERMINATE, + KILL_KILL, + KILL_ABORT, +} KillOperation; + static inline bool UNIT_IS_ACTIVE_OR_RELOADING(UnitActiveState t) { return t == UNIT_ACTIVE || t == UNIT_RELOADING; } @@ -112,7 +119,10 @@ struct Unit { /* JOB_NOP jobs are special and can be installed without disturbing the real job. */ Job *nop_job; + /* Job timeout and action to take */ usec_t job_timeout; + FailureAction job_timeout_action; + char *job_timeout_reboot_arg; /* References to this */ LIST_HEAD(UnitRef, refs); @@ -572,7 +582,7 @@ int unit_write_drop_in_private_format(Unit *u, UnitSetPropertiesMode mode, const int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name); -int unit_kill_context(Unit *u, KillContext *c, bool sigkill, pid_t main_pid, pid_t control_pid, bool main_pid_alien); +int unit_kill_context(Unit *u, KillContext *c, KillOperation k, pid_t main_pid, pid_t control_pid, bool main_pid_alien); int unit_make_transient(Unit *u);