summaryrefslogtreecommitdiff
path: root/src/core/unit.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-06-28 04:12:58 +0200
committerLennart Poettering <lennart@poettering.net>2013-06-28 04:12:58 +0200
commitc2756a68401102786be343712c0c35acbd73d28d (patch)
tree64af93633ce57982937323c9a55fe1ecbf076cd1 /src/core/unit.h
parent1508e85878cff23a220b2ff8d6c71418e19797de (diff)
core: add transient units
Transient units can be created via the bus API. They are configured via the method call parameters rather than on-disk files. They are subject to normal GC. Transient units currently may only be created for services (however, we will extend this), and currently only ExecStart= and the cgroup parameters can be configured (also to be extended). Transient units require a unique name, that previously had no configuration file on disk. A tool systemd-run is added that makes use of this functionality to run arbitrary command lines as transient services: $ systemd-run /bin/ping www.heise.de Will cause systemd to create a new transient service and run ping in it.
Diffstat (limited to 'src/core/unit.h')
-rw-r--r--src/core/unit.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/unit.h b/src/core/unit.h
index be6abaff98..8a62787b38 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -241,6 +241,9 @@ struct Unit {
/* Did the last condition check succeed? */
bool condition_result;
+ /* Is this a transient unit? */
+ bool transient;
+
bool in_load_queue:1;
bool in_dbus_queue:1;
bool in_cleanup_queue:1;
@@ -425,6 +428,9 @@ struct UnitVTable {
/* Exclude from automatic gc */
bool no_gc:1;
+
+ /* True if transient units of this type are OK */
+ bool can_transient:1;
};
extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX];
@@ -595,6 +601,8 @@ 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_make_transient(Unit *u);
+
const char *unit_active_state_to_string(UnitActiveState i) _const_;
UnitActiveState unit_active_state_from_string(const char *s) _pure_;