chiark / gitweb /
service: when after startup only one process is in a service's cgroup, assume it...
[elogind.git] / src / unit.h
index 47a1eb635036156df05e216c4bd7f67931845e40..3f0ef01c5e871f0f9d9446f3359f8b9f85d929af 100644 (file)
@@ -38,8 +38,8 @@ typedef enum UnitDependency UnitDependency;
 #include "list.h"
 #include "socket-util.h"
 #include "execute.h"
+#include "condition.h"
 
-#define UNIT_NAME_MAX 256
 #define DEFAULT_TIMEOUT_USEC (60*USEC_PER_SEC)
 #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
 
@@ -63,6 +63,7 @@ enum UnitLoadState {
         UNIT_LOADED,
         UNIT_ERROR,
         UNIT_MERGED,
+        UNIT_MASKED,
         _UNIT_LOAD_STATE_MAX,
         _UNIT_LOAD_STATE_INVALID = -1
 };
@@ -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;
@@ -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);
@@ -504,6 +512,9 @@ bool unit_pending_active(Unit *u);
 
 int unit_add_default_target_dependency(Unit *u, Unit *target);
 
+UnitType unit_name_to_type(const char *n);
+bool unit_name_is_valid(const char *n, bool template_ok);
+
 const char *unit_load_state_to_string(UnitLoadState i);
 UnitLoadState unit_load_state_from_string(const char *s);
 
@@ -513,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