X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Funit.h;h=8b6b58e53bd3b338a7a134d4e41b1a94a46526a1;hb=941a4041bdb9d91e9d5033005263efe029621e4f;hp=605fa3774d8944ec4c27a0d5514dcc408efecfa7;hpb=6daf4f9001d87da9e92c04ff606b454c209f0951;p=elogind.git diff --git a/src/unit.h b/src/unit.h index 605fa3774..8b6b58e53 100644 --- a/src/unit.h +++ b/src/unit.h @@ -38,6 +38,7 @@ typedef enum UnitDependency UnitDependency; #include "list.h" #include "socket-util.h" #include "execute.h" +#include "condition.h" #define DEFAULT_TIMEOUT_USEC (60*USEC_PER_SEC) #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC) @@ -104,7 +105,7 @@ enum UnitDependency { /* Inverse of the above */ UNIT_REQUIRED_BY, /* inverse of 'requires' and 'requisite' is 'required_by' */ - UNIT_REQUIRED_BY_OVERRIDABLE, /* inverse of 'soft_requires' and 'soft_requisite' is 'soft_required_by' */ + UNIT_REQUIRED_BY_OVERRIDABLE, /* inverse of 'requires_overridable' and 'requisite_overridable' is 'soft_required_by' */ UNIT_WANTED_BY, /* inverse of 'wants' */ /* Negative dependencies */ @@ -154,6 +155,9 @@ struct Meta { usec_t job_timeout; + /* Conditions to check */ + LIST_HEAD(Condition, conditions); + dual_timestamp inactive_exit_timestamp; dual_timestamp active_enter_timestamp; dual_timestamp active_exit_timestamp; @@ -187,8 +191,8 @@ struct Meta { /* Error code when we didn't manage to load the unit (negative) */ int load_error; - /* If we go down, pull down everything that depends on us, too */ - bool recursive_stop; + /* If some required dep goes down, pull down ourselves, too */ + bool stop_retroactively; /* Garbage collect us we nobody wants or requires us anymore */ bool stop_when_unneeded; @@ -273,6 +277,8 @@ struct UnitVTable { int (*stop)(Unit *u); int (*reload)(Unit *u); + int (*kill)(Unit *u, KillWho w, KillMode m, int signo, DBusError *error); + bool (*can_reload)(Unit *u); /* Write all data that cannot be restored from other sources @@ -454,6 +460,8 @@ int unit_start(Unit *u); int unit_stop(Unit *u); int unit_reload(Unit *u); +int unit_kill(Unit *u, KillWho w, KillMode m, int signo, DBusError *error); + void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns); int unit_watch_fd(Unit *u, int fd, uint32_t events, Watch *w); @@ -516,7 +524,4 @@ UnitActiveState unit_active_state_from_string(const char *s); const char *unit_dependency_to_string(UnitDependency i); UnitDependency unit_dependency_from_string(const char *s); -const char *kill_mode_to_string(KillMode k); -KillMode kill_mode_from_string(const char *s); - #endif