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 2020/02/25 07:17:32 UTC

[GitHub] [incubator-dolphinscheduler] liwenhe1993 opened a new issue #2015: [Feature] Support worker server to run bat script

liwenhe1993 opened a new issue #2015: [Feature] Support worker server to run bat script
URL: https://github.com/apache/incubator-dolphinscheduler/issues/2015
 
 
   Run a program or script as another user, there is `sudo -u` in Unix-like, but there is no `sudo -u` command in Windows, the nearest equivalent is `runas` command.
   
   ***But can't pipe a password into runas, because it requests the password `from the terminal`, `not from stdin`.***
   
   So, I have to reimplement `ProcessImpl.java`, `ProcessEnvironment.java` and `ProcessBuilder.java` for Windows.
   
   **First, for Windows, I will reimplement it by `JNA`:**
   
   > `ProcessBuilder.java`: *copy and rewrite it*
   
   > `ProcessEnvironment.java`:  *rewrrite it by `JNA`*
   > ```java
   > private static native String environmentBlock();
   > ```
   
   > `ProcessImpl.java`: *rewrrite it by `JNA`*
   > ```java
   > private static native int getStillActive();
   > private static native int getExitCodeProcess(long handle);
   > private static native void waitForInterruptibly(long handle);
   > private static native void waitForTimeoutInterruptibly(long handle, long timeout);
   > private static native void terminateProcess(long handle);
   > private static native boolean isProcessAlive(long handle);
   > private static synchronized native long create(String cmdstr, String envblock, String dir, long[] stdHandles, boolean redirectErrorStream)
   > private static native long openForAtomicAppend(String path) throws IOException;
   > private static native boolean closeHandle(long handle);
   > ```
   
   **Finally, I will create new file in ds, like `ProcessBuilderForWin32.java`, `ProcessEnvironmentForWin32.java`, `ProcessImplForWin32.java`**
   
   So, how about it?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] dailidong closed issue #2015: [Feature] Support worker server to run bat script

Posted by GitBox <gi...@apache.org>.
dailidong closed issue #2015: [Feature] Support worker server to run bat script
URL: https://github.com/apache/incubator-dolphinscheduler/issues/2015
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services