1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

run: make --working-directory= work for --scope too

This sounds like a more user-friendly alternative to #24780
This commit is contained in:
Lennart Poettering 2022-09-22 14:21:46 +02:00
parent c7b5ea6955
commit fecc447766

View File

@ -1529,6 +1529,9 @@ static int start_transient_scope(sd_bus *bus) {
return log_error_errno(errno, "Failed to change UID to " UID_FMT ": %m", uid);
}
if (arg_working_directory && chdir(arg_working_directory) < 0)
return log_error_errno(errno, "Failed to change directory to '%s': %m", arg_working_directory);
env = strv_env_merge(environ, user_env, arg_environment);
if (!env)
return log_oom();