summaryrefslogtreecommitdiffstats
path: root/src/portable
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-05-29 21:34:29 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-05-29 21:34:43 +0200
commit6a49fcdb3c90e00d8da350464816dcb63336353f (patch)
tree6d338761fee08820c13b13fe1004c6111d02f073 /src/portable
parenttest: drop redundant log message (diff)
downloadsystemd-6a49fcdb3c90e00d8da350464816dcb63336353f.tar.xz
systemd-6a49fcdb3c90e00d8da350464816dcb63336353f.zip
portable: try to remove unit files even in a spurious state
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/portable.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/portable/portable.c b/src/portable/portable.c
index c4f42f9500..254d9f6abe 100644
--- a/src/portable/portable.c
+++ b/src/portable/portable.c
@@ -1560,7 +1560,6 @@ int portable_detach(
FOREACH_DIRENT(de, d, return log_debug_errno(errno, "Failed to enumerate '%s' directory: %m", where)) {
_cleanup_free_ char *marker = NULL;
- UnitFileState state;
if (!unit_name_is_valid(de->d_name, UNIT_NAME_ANY))
continue;
@@ -1578,12 +1577,6 @@ int portable_detach(
if (r == 0)
continue;
- r = unit_file_lookup_state(LOOKUP_SCOPE_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, 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);
if (r < 0)
return r;