Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/learning/howto/runner-service-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ endlocal

7. Execute the following command (you can copy and paste it directly on the CMD terminal to execute it):

:::: tabs
Comment thread
fdevans marked this conversation as resolved.

@tab Standard (`java` mode)

```bat
runner.exe //IS//Runner ^
--DisplayName=Runner ^
Expand Down Expand Up @@ -168,6 +172,43 @@ runner.exe //IS//Runner ^
The service name uses a double slash (`//IS//runner`) — this is the procrun syntax for "install service". `--Jvm=auto` lets procrun locate `jvm.dll` automatically from `JAVA_HOME` / the registry. The stop is delegated to `stop-runner.bat` through `cmd.exe`; the full path to `cmd.exe` is required because procrun passes `--StopImage` directly to `CreateProcess`, which does not search the `PATH` (a bare `cmd` fails with `The system cannot find the file specified`).
Comment thread
fdevans marked this conversation as resolved.
:::

@tab Alternative More logging (`jvm` mode)
Comment thread
fdevans marked this conversation as resolved.
Outdated

With `--StartMode=java`, procrun launches the Runner as a **separate** `java.exe` process and does not pipe that process's output into `--StdOutput`/`--StdError`, so `runner.log` can stay empty. Use this `jvm`-mode variant instead: procrun loads the JVM **in-process** and captures the Runner's `System.out`/`System.err` directly into the log file.

```bat
runner.exe //IS//Runner ^
--DisplayName=Runner ^
--LogLevel=Info ^
--LogPath=C:\runner ^
--ServiceUser=LocalSystem ^
--Startup=auto ^
--Jvm="<JAVA_INSTALL_PATH>\bin\server\jvm.dll" ^
--StartMode=jvm ^
--Classpath=C:\runner\runner.jar ^
--StartClass=com.rundeck.runner.agent.RunnerApplication ^
--StartMethod=main ^
--StartPath=C:\runner ^
--StopMode=exe ^
--StopImage=C:\Windows\System32\cmd.exe ^
--StopParams=/c#C:\runner\stop-runner.bat ^
--StopPath=C:\runner ^
--StopTimeout=30 ^
--PidFile=runner.pid ^
--JvmMs=1024 ^
--JvmMx=4096 ^
--StdOutput=C:\runner\runner.log ^
--StdError=C:\runner\runner.log
```

:::warning Set `--Jvm` to your real `jvm.dll` path
In `jvm` mode `--Jvm=auto` often fails with `no JVM configured or found in registry` (many JDK/JRE builds don't register in the Windows registry, and the `LocalSystem` account doesn't see a user-level `JAVA_HOME`). Replace `<JAVA_INSTALL_PATH>` with your Java installation directory (the same path as `JAVA_HOME`)
Comment thread
fdevans marked this conversation as resolved.
Outdated

Note that `jvm` mode replaces `--StartMode=java`/`--StartParams=-jar#runner.jar` with `--StartMode=jvm`, `--Classpath` (the path to `runner.jar`) and `--StartClass` (the Runner main class). The `runner.exe` (procrun) and the `jvm.dll` must be the **same architecture** (use the 64-bit `prunsrv.exe` from `amd64\` with a 64-bit JRE/JDK).
:::

::::
Comment thread
fdevans marked this conversation as resolved.

You will see messages similar to the following:

```log
Expand Down
Loading