summaryrefslogtreecommitdiff
path: root/src/core/job.c
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/job.c
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/job.c')
-rw-r--r--src/core/job.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/job.c b/src/core/job.c
index d304a16d06..85f77e8f0d 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -1088,10 +1088,13 @@ void job_shutdown_magic(Job *j) {
* asynchronous sync() would cause their exit to be
* delayed. */
- if (!unit_has_name(j->unit, SPECIAL_SHUTDOWN_TARGET))
+ if (j->type != JOB_START)
return;
- if (j->type != JOB_START)
+ if (j->unit->manager->running_as != SYSTEMD_SYSTEM)
+ return;
+
+ if (!unit_has_name(j->unit, SPECIAL_SHUTDOWN_TARGET))
return;
if (detect_container(NULL) > 0)