You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by zh...@apache.org on 2023/05/22 12:48:46 UTC
[dolphinscheduler] branch dev updated: [Bug][Worker] generate kill command with unknown user: default (#14145)
This is an automated email from the ASF dual-hosted git repository.
zhongjiajie pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 5e87b2d58a [Bug][Worker] generate kill command with unknown user: default (#14145)
5e87b2d58a is described below
commit 5e87b2d58a91cfb29839d82465380e43c0a1ab03
Author: Aaron Wang <wa...@gmail.com>
AuthorDate: Mon May 22 20:48:40 2023 +0800
[Bug][Worker] generate kill command with unknown user: default (#14145)
---
.../main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java
index 678abff0c6..d133046981 100644
--- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java
+++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java
@@ -18,6 +18,7 @@
package org.apache.dolphinscheduler.common.utils;
import org.apache.dolphinscheduler.common.constants.Constants;
+import org.apache.dolphinscheduler.common.constants.TenantConstants;
import org.apache.dolphinscheduler.common.shell.ShellExecutor;
import oshi.SystemInfo;
@@ -386,6 +387,8 @@ public class OSUtils {
if (!isSudoEnable() || StringUtils.isEmpty(tenantCode)) {
return command;
}
+ tenantCode = TenantConstants.DEFAULT_TENANT_CODE.equals(tenantCode) ? TenantConstants.BOOTSTRAPT_SYSTEM_USER
+ : tenantCode;
return String.format("sudo -u %s %s", tenantCode, command);
}