You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/07/26 10:21:28 UTC

[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #11018: [improverment]:The install.sh script does not check whether the user has sudo privileges

zhongjiajie commented on code in PR #11018:
URL: https://github.com/apache/dolphinscheduler/pull/11018#discussion_r929789901


##########
script/install.sh:
##########
@@ -22,14 +22,21 @@ workDir=`cd ${workDir};pwd`
 source ${workDir}/env/install_env.sh
 source ${workDir}/env/dolphinscheduler_env.sh
 
+
 echo "1.create directory"
 
 # If install Path equal to "/" or related path is "/" or is empty, will cause directory "/bin" be overwrite or file adding,
 # so we should check its value. Here use command `realpath` to get the related path, and it will skip if your shell env
 # without command `realpath`.
 if [ ! -d $installPath ];then
-  sudo mkdir -p $installPath
-  sudo chown -R $deployUser:$deployUser $installPath
+  echo "sudo enabled = ${sudoEnable}"
+   if [ ${sudoEnable} = true ]; then
+      sudo mkdir -p $installPath
+      sudo chown -R $deployUser:$deployUser $installPath
+    else
+      mkdir -p $installPath
+      chown -R $deployUser:$deployUser $installPath
+    fi

Review Comment:
   Why we need this?  should we directly remove the `sudo` and require user have permission of `installPath`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org