From 9d6453cc4facdb609a55851d6974aa3a5c210004 Mon Sep 17 00:00:00 2001 From: JessamyT <75634662+JessamyT@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:27:27 -0800 Subject: [PATCH] DOCS-1521: Document Execute Once process behavior (#2381) --- docs/build/configure/_index.md | 17 +++++++++-------- docs/tutorials/custom/custom-base-dog.md | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/build/configure/_index.md b/docs/build/configure/_index.md index b4a59007f9..2edddf4467 100644 --- a/docs/build/configure/_index.md +++ b/docs/build/configure/_index.md @@ -227,17 +227,18 @@ Find more information in our [remotes documentation](/build/configure/parts-and- To automatically run a specified script when the machine boots, configure a _process_. -Start by giving the process a **Name** (`id` in raw JSON) (an identifier of your choice) and clicking **Create Process**. +Start by giving the process a **Name** (`id` in raw JSON) (an identifier of your choice) and clicking **Create process**. Then fill in the following fields: -- **Executable** (`name`): The command you want to execute when your machine connects to the server. -- **Arguments** (`args`): Optional arguments to follow the command. -- **Working Directory** (`cwd`): Where you want the process to execute. - An optional setting that defaults to the directory where `viam-server` executes. - -You can also toggle whether you want errors and other messages to be logged, and whether to execute the command just once or keep running the process indefinitely. -In raw JSON, these options are represented by `log` (bool) and `one_shot` (bool), respectively. + +| Attribute (Builder Mode) | Attribute (Raw JSON) | Type | Inclusion | Description | +| ------------------------ | -------------------- | ------- | ------------ | ----------- | +| Executable | `name` | string | **Required** | The command you want to execute when your machine connects to the server. | +| Arguments | `args` | string | Optional | Arguments to follow the command. | +| Working directory | `cwd` | string | Optional | Where you want the process to execute. Defaults to the directory where `viam-server` executes. | +| Logging | `log` | boolean | Optional | Toggle logging of errors and other messages on or off. Default: `false`. | +| Execute once | `one_shot` | boolean | Optional | Toggle whether to execute the command just once or keep running the process indefinitely. | {{% expand "Click to see an example of a configured process." %}} diff --git a/docs/tutorials/custom/custom-base-dog.md b/docs/tutorials/custom/custom-base-dog.md index d5899c9da0..75a448b23c 100644 --- a/docs/tutorials/custom/custom-base-dog.md +++ b/docs/tutorials/custom/custom-base-dog.md @@ -421,11 +421,11 @@ Fill out the config panel as follows: - **Arguments**: Type in `main.py` and click **Add argument**. Then type `-tn` and click **Add argument** again. This flag starts the Freenove server without launching Freenove's GUI (which you don't need for this use case). -- **Working Directory**: `/home/fido/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server` (changing "/home/fido" to the name of your home directory where you downloaded the Freenove code). +- **Working directory**: `/home/fido/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server` (changing "/home/fido" to the name of your home directory where you downloaded the Freenove code). - **Logging**: Toggle to the **on** position so you can view logs for this server process. - **Execute once**: Leave this **off** so that the Freenove server will continue to run, and will restart if it crashes. -Click **Save Config** at the bottom of the window. +Click **Save config** at the bottom of the window. ![Screenshot of the Processes subtab of the Config tab, showing a process configured as detailed above.](/tutorials/custom-base-dog/process-config.png)