From 0faacd470dfbd24f4c6504da6f04213aa05f9d19 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Dec 2014 21:05:32 +0100 Subject: 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. --- src/core/unit.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/unit.h') 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; -- cgit v1.2.3-54-g00ecf