diff options
author | Daniel Mack <zonque@gmail.com> | 2014-03-17 11:41:21 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-03-19 02:25:36 +0100 |
commit | 5892a914d173e4b968d2a14fbf717373dee3999a (patch) | |
tree | ca7305c322b9f7544d888e4cfac6de93cca8ac5f /src/libsystemd/sd-bus | |
parent | ec8408740a32888f0bbbdcb79ccfbf550b12f19f (diff) |
busname: introduce Activating directive
Add a new config 'Activating' directive which denotes whether a busname
is actually registered on the bus. It defaults to 'yes'.
If set to 'no', the .busname unit only uploads policy, which will remain
active as long as the unit is running.
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r-- | src/libsystemd/sd-bus/bus-kernel.c | 6 | ||||
-rw-r--r-- | src/libsystemd/sd-bus/bus-kernel.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index 977a7cda40..00f58114ac 100644 --- a/src/libsystemd/sd-bus/bus-kernel.c +++ b/src/libsystemd/sd-bus/bus-kernel.c @@ -1378,7 +1378,7 @@ static void bus_kernel_translate_policy(const BusNamePolicy *policy, struct kdbu } } -int bus_kernel_create_starter(const char *bus, const char *name, bool accept_fd, BusNamePolicy *policy) { +int bus_kernel_create_starter(const char *bus, const char *name, bool activating, bool accept_fd, BusNamePolicy *policy) { struct kdbus_cmd_hello *hello; struct kdbus_item *n; size_t policy_cnt = 0; @@ -1420,7 +1420,9 @@ int bus_kernel_create_starter(const char *bus, const char *name, bool accept_fd, } hello->size = size; - hello->conn_flags = KDBUS_HELLO_ACTIVATOR | (accept_fd ? KDBUS_HELLO_ACCEPT_FD : 0); + hello->conn_flags = + (activating ? KDBUS_HELLO_ACTIVATOR : KDBUS_HELLO_POLICY_HOLDER) | + (accept_fd ? KDBUS_HELLO_ACCEPT_FD : 0); hello->pool_size = KDBUS_POOL_SIZE; hello->attach_flags = _KDBUS_ATTACH_ALL; diff --git a/src/libsystemd/sd-bus/bus-kernel.h b/src/libsystemd/sd-bus/bus-kernel.h index 3a9794fbe3..4ef26fce64 100644 --- a/src/libsystemd/sd-bus/bus-kernel.h +++ b/src/libsystemd/sd-bus/bus-kernel.h @@ -67,7 +67,7 @@ int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority); int bus_kernel_create_bus(const char *name, bool world, char **s); int bus_kernel_create_domain(const char *name, char **s); -int bus_kernel_create_starter(const char *bus, const char *name, bool accept_fd, BusNamePolicy *policy); +int bus_kernel_create_starter(const char *bus, const char *name, bool activating, bool accept_fd, BusNamePolicy *policy); int bus_kernel_create_monitor(const char *bus); int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *allocated); |