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
+37-1Lines changed: 37 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,10 @@ For information on managing the service, see [Manage `viam-agent`](/manage/refer
102
102
"viam_server_start_timeout_minutes": 10,
103
103
"disable_viam_server": false,
104
104
"disable_network_configuration": false,
105
-
"disable_system_configuration": false
105
+
"disable_system_configuration": false,
106
+
"viam_server_env": {
107
+
"CUSTOM_VAR": "value"
108
+
}
106
109
},
107
110
"network_configuration": {
108
111
"manufacturer": "viam",
@@ -205,9 +208,42 @@ To update the version of `viam-server` (or the RDK) update the machine settings.
205
208
|`disable_network_configuration`| boolean | Optional | Disables the network and hotspot configuration, as well as the configuration of additional networks. Default: `false`. |
206
209
|`disable_system_configuration`| boolean | Optional | Disables the system configuration. Default: `false`. |
207
210
|`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`. |
211
+
|`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). |
208
212
|`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`. |
209
213
|`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`. |
210
214
215
+
### Environment Variables for viam-server
216
+
217
+
You can configure environment variables for `viam-server` using the `viam_server_env` setting in `advanced_settings`.
218
+
Environment variables set through `viam_server_env` are passed to `viam-server` and all child processes it launches, including modules.
219
+
`viam-server` also inherits existing environment variables from `viam-agent`, such as `HOME`, `PWD`, `TERM`, `PATH`.
220
+
221
+
{{< alert title="Important" color="note" >}}
222
+
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.
223
+
This restart will occur immediately if `viam-server` is in a maintenance window and not currently processing configuration changes.
224
+
{{< /alert >}}
225
+
226
+
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`.
227
+
228
+
#### Example configurations
229
+
230
+
```json
231
+
{
232
+
"agent": {
233
+
"advanced_settings": {
234
+
"viam_server_env": {
235
+
"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.
246
+
211
247
### Reduce startup time
212
248
213
249
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