You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/manage/reference/viam-agent/_index.md
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,9 @@ For information on managing the service, see [Manage `viam-agent`](/manage/refer
103
103
"disable_viam_server": false,
104
104
"disable_network_configuration": false,
105
105
"disable_system_configuration": false
106
+
"viam_server_env": {
107
+
"CUSTOM_VAR": "value"
108
+
}
106
109
},
107
110
"network_configuration": {
108
111
"manufacturer": "viam",
@@ -202,9 +205,42 @@ To update the version of `viam-server` (or the RDK) update the machine settings.
202
205
|`disable_network_configuration`| boolean | Optional | Disables the network and hotspot configuration, as well as the configuration of additional networks. Default: `false`. |
203
206
|`disable_system_configuration`| boolean | Optional | Disables the system configuration. Default: `false`. |
204
207
|`disable_viam_server`| boolean | Optional | Disable `viam-server` remotely. This option is often used by developers working on Viam agent or when manually running `viam-server`. Default: `false`. |
208
+
|`viam_server_env`| object | Optional | A map of environment variable names to values that `viam-agent` passes to `viam-server` and its child processes (including modules). Both keys and values must be strings. See [Environment Variables for viam-server](#environment-variables-for-viam-server). Default: `{}` (empty). |
205
209
|`viam_server_start_timeout_minutes`| integer | Optional | Specify a time after which, if `viam-server` hasn't successfully started, Viam agent will kill it and restart. Default: `10`. |
206
210
|`wait_for_update_check`| boolean | Optional | If set to `true`, `viam-agent` will wait for a network connection and check for updates before starting `viam-server`. See [Reduce startup time](#reduce-startup-time). Default: `false`. |
207
211
212
+
### Environment Variables for viam-server
213
+
214
+
You can configure environment variables for `viam-server` using the `viam_server_env` setting in `advanced_settings`.
215
+
Environment variables set through `viam_server_env` are passed to `viam-server` and all child processes it launches, including modules.
216
+
`viam-server` also inherits existing environment variables from `viam-agent`, such as `HOME`, `PWD`, `TERM`, `PATH`.
217
+
218
+
{{< alert title="Important" color="note" >}}
219
+
When you change environment variables in `viam_server_env`, `viam-agent` will automatically restart `viam-server` to apply these and any other changes made before saving.
220
+
This restart will occur immediately if `viam-server` is in a maintenance window and not currently processing configuration changes.
221
+
{{< /alert >}}
222
+
223
+
Changes to `viam_server_env` are the only changes that automatically trigger a `viam-server` restart. Changing other configuration options requires a manual restart unless you've also changed `viam_server_env`.
224
+
225
+
#### Example configurations
226
+
227
+
```json
228
+
{
229
+
"agent": {
230
+
"advanced_settings": {
231
+
"viam_server_env": {
232
+
"PION_LOG_TRACE": "all", # Debug logging for WebRTC
To remove an environment variable, remove it from the `viam_server_env` object and save your configuration.
243
+
208
244
### Reduce startup time
209
245
210
246
You can set `wait_for_update_check` to `false` to bypass `viam-agent` waiting for a network connection to be established and checking for updates during initial startup.
0 commit comments