#include "condition.h"
#include "install.h"
#include "unit-name.h"
+#include "failure-action.h"
enum UnitActiveState {
UNIT_ACTIVE,
_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;
}
/* 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);
dual_timestamp active_exit_timestamp;
dual_timestamp inactive_enter_timestamp;
- /* Counterparts in the cgroup filesystem */
- char *cgroup_path;
- CGroupControllerMask cgroup_realized_mask;
- CGroupControllerMask cgroup_subtree_mask;
- CGroupControllerMask cgroup_members_mask;
-
UnitRef slice;
/* Per type list */
/* Cached unit file state */
UnitFileState unit_file_state;
+ /* Counterparts in the cgroup filesystem */
+ char *cgroup_path;
+ CGroupControllerMask cgroup_realized_mask;
+ CGroupControllerMask cgroup_subtree_mask;
+ CGroupControllerMask cgroup_members_mask;
+
+ /* How to start OnFailure units */
+ JobMode on_failure_job_mode;
+
/* Garbage collect us we nobody wants or requires us anymore */
bool stop_when_unneeded;
/* Allow isolation requests */
bool allow_isolate;
- /* How to start OnFailure units */
- JobMode on_failure_job_mode;
-
/* Ignore this unit when isolating */
bool ignore_on_isolate;
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);