]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portabled: allow to detach an image with a unit in linked-runtime state 13726/head
authorLuca Boccassi <luca.boccassi@microsoft.com>
Fri, 4 Oct 2019 13:45:41 +0000 (14:45 +0100)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Fri, 4 Oct 2019 13:45:41 +0000 (14:45 +0100)
This is necessary when a directory was attached with
--copy=symlink, otherwise detach will always fail.

Fixed #13725

src/portable/portable.c

index d37880cfd1d8fbe27666fdfdb26cd7a6ee2a4aa7..34b123e846925b4a5d62ccc83a22d9712f8fb154 100644 (file)
@@ -1187,7 +1187,7 @@ int portable_detach(
                 r = unit_file_lookup_state(UNIT_FILE_SYSTEM, &paths, de->d_name, &state);
                 if (r < 0)
                         return log_debug_errno(r, "Failed to determine unit file state of '%s': %m", de->d_name);
-                if (!IN_SET(state, UNIT_FILE_STATIC, UNIT_FILE_DISABLED, UNIT_FILE_LINKED, UNIT_FILE_RUNTIME))
+                if (!IN_SET(state, UNIT_FILE_STATIC, UNIT_FILE_DISABLED, UNIT_FILE_LINKED, UNIT_FILE_RUNTIME, UNIT_FILE_LINKED_RUNTIME))
                         return sd_bus_error_setf(error, BUS_ERROR_UNIT_EXISTS, "Unit file '%s' is in state '%s', can't detach.", de->d_name, unit_file_state_to_string(state));
 
                 r = unit_file_is_active(bus, de->d_name, error);