diff options
author | Iago López Galeiras <iaguis@gmail.com> | 2015-11-09 11:32:34 +0100 |
---|---|---|
committer | Iago López Galeiras <iaguis@gmail.com> | 2015-11-09 16:40:05 +0100 |
commit | 6aadfa4c5239f6cd2a80e82f6bc102cc116583df (patch) | |
tree | d38cfce939d81c7fcff857ef14234aa10c36c0b9 /src/nspawn/nspawn-register.c | |
parent | 2933d599c242ebfc70ddcffe59163916b02270f1 (diff) |
nspawn: support custom container service name
We were hardcoding "systemd-nspawn" as the value of the $container env
variable and "nspawn" as the service string in machined registration.
This commit allows the user to configure it by setting the
$SYSTEMD_NSPAWN_CONTAINER_SERVICE env variable when calling
systemd-nspawn.
If $SYSTEMD_NSPAWN_CONTAINER_SERVICE is not set, we use the string
"systemd-nspawn" for both, fixing the previous inconsistency.
Diffstat (limited to 'src/nspawn/nspawn-register.c')
-rw-r--r-- | src/nspawn/nspawn-register.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nspawn/nspawn-register.c b/src/nspawn/nspawn-register.c index 7139ad9958..374f958c20 100644 --- a/src/nspawn/nspawn-register.c +++ b/src/nspawn/nspawn-register.c @@ -39,7 +39,8 @@ int register_machine( unsigned n_mounts, int kill_signal, char **properties, - bool keep_unit) { + bool keep_unit, + const char *service) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_flush_close_unref_ sd_bus *bus = NULL; @@ -61,7 +62,7 @@ int register_machine( "sayssusai", machine_name, SD_BUS_MESSAGE_APPEND_ID128(uuid), - "nspawn", + service, "container", (uint32_t) pid, strempty(directory), @@ -86,7 +87,7 @@ int register_machine( "sayssusai", machine_name, SD_BUS_MESSAGE_APPEND_ID128(uuid), - "nspawn", + service, "container", (uint32_t) pid, strempty(directory), |