summaryrefslogtreecommitdiff
path: root/src/core/unit.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-12 21:05:32 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-15 19:02:17 +0100
commit0faacd470dfbd24f4c6504da6f04213aa05f9d19 (patch)
tree9b13b654d993efc475f9209f8b1cf602850ee27b /src/core/unit.h
parent17d1f37d0dbd2d78b8866e1350c83a9755105144 (diff)
unit: handle nicely of certain unit types are not supported on specific systems
Containers do not really support .device, .automount or .swap units; Systems compiled without support for swap do not support .swap units; Systems without kdbus do not support .busname units. With this change attempts to start a unsupported unit types will result in an immediate "unsupported" job result, which is a lot more descriptive then before. Also, attempts to start device units in containers will now immediately fail instead of causing jobs to be enqueued that never go away.
Diffstat (limited to 'src/core/unit.h')
-rw-r--r--src/core/unit.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/unit.h b/src/core/unit.h
index f6587ba5f0..19fa2f0585 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -396,6 +396,10 @@ struct UnitVTable {
/* Type specific cleanups. */
void (*shutdown)(Manager *m);
+ /* If this function is set and return false all jobs for units
+ * of this type will immediately fail. */
+ bool (*supported)(Manager *m);
+
/* The interface name */
const char *bus_interface;