|
| 1 | +--- |
| 2 | +linkTitle: "Configure machine settings" |
| 3 | +title: "Configure machine operating system settings" |
| 4 | +weight: 50 |
| 5 | +layout: "docs" |
| 6 | +type: "docs" |
| 7 | +description: "Configure network settings, operating system package updates and logging defaults." |
| 8 | +--- |
| 9 | + |
| 10 | +The `viam-agent` configuration allows you to configure: |
| 11 | + |
| 12 | +- [settings for package updates for the host operating system](#configure-os-package-updates) |
| 13 | +- [networks a machine can connect to](#configure-networks) |
| 14 | +- [parameters for operating system logging](#configure-operating-system-logging) |
| 15 | + |
| 16 | +## Configure OS package updates |
| 17 | + |
| 18 | +By default, the configuration in <FILE>/etc/apt/apt.conf.d/</FILE> determines the behavior for updating operating system packages. |
| 19 | +To adjust these settings update the `"agent"` value in the machine's JSON configuration. |
| 20 | + |
| 21 | +For complete reference information, see [viam-agent](/configure/agent/#agent-syscfg). |
| 22 | + |
| 23 | +### Automatically upgrade all packages |
| 24 | + |
| 25 | +When set, `viam-agent` will install the `unattended-upgrades` package and replace `20auto-upgrades` and `50unattended-upgrades` in <FILE>/etc/apt/apt.conf.d/</FILE> with an Origins-Pattern list generated automatically from configured repositories on the system. |
| 26 | +Custom repos installed on the system at the time the setting is enabled will be included. |
| 27 | + |
| 28 | +To set automatic upgrades for all packages, add the `upgrades` field to the `agent-syscfg`'s `attributes` object as following. |
| 29 | +You may need to add the `agent-syscfg` object to the `agent` object if it doesn't already exist. |
| 30 | + |
| 31 | + |
| 32 | +```json |
| 33 | +"agent": { |
| 34 | + "agent-syscfg": { |
| 35 | + "release_channel": "stable", |
| 36 | + "attributes": { |
| 37 | + "upgrades": { |
| 38 | + "type": "all" |
| 39 | + } |
| 40 | + } |
| 41 | + } |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +### Automatically upgrade security packages |
| 46 | + |
| 47 | +When set, `viam-agent` will install the `unattended-upgrades` package and replace `20auto-upgrades` and `50unattended-upgrades` in <FILE>/etc/apt/apt.conf.d/</FILE> with an Origins-Pattern list generated automatically from configured repositories on the system. |
| 48 | +Custom repos installed on the system at the time the setting is enabled will be included. |
| 49 | + |
| 50 | +To set automatic upgrades for packages containing `"security"` in their codename (for example `bookworm-security`), add the `upgrades` field to the `agent-syscfg`'s `attributes` object as following. |
| 51 | +You may need to add the `agent-syscfg` object to the `agent` object if it doesn't already exist. |
| 52 | + |
| 53 | +```json |
| 54 | +"agent": { |
| 55 | + "agent-syscfg": { |
| 56 | + "release_channel": "stable", |
| 57 | + "attributes": { |
| 58 | + "upgrades": { |
| 59 | + "type": "security" |
| 60 | + } |
| 61 | + } |
| 62 | + } |
| 63 | +} |
| 64 | +``` |
| 65 | + |
| 66 | +### Disable automatic upgrades |
| 67 | + |
| 68 | +When set, `viam-agent` will install the `unattended-upgrades` package and replace `20auto-upgrades` and `50unattended-upgrades` in <FILE>/etc/apt/apt.conf.d/</FILE> with an Origins-Pattern list generated automatically from configured repositories on the system. |
| 69 | +Custom repos installed on the system at the time the setting is enabled will be included. |
| 70 | + |
| 71 | +To set automatic upgrades, add the `upgrades` field to the `agent-syscfg`'s `attributes` object. |
| 72 | +You may need to add the `agent-syscfg` object to the `agent` object if it doesn't already exist. |
| 73 | + |
| 74 | +```json |
| 75 | +"agent": { |
| 76 | + "agent-syscfg": { |
| 77 | + "release_channel": "stable", |
| 78 | + "attributes": { |
| 79 | + "upgrades": { |
| 80 | + "type": "security" |
| 81 | + } |
| 82 | + } |
| 83 | + } |
| 84 | +} |
| 85 | +``` |
| 86 | + |
| 87 | +## Configure networks |
| 88 | + |
| 89 | +By default, your machine can connect to networks added at the operating system level, for example, directly in NetworkManager. |
| 90 | + |
| 91 | +For an already-online device, you can add new WiFi networks by updating the `"agent"` value in the machine's JSON configuration. |
| 92 | +This is primarily useful for a machine that moves between different networks, so the machine can automatically connect when moved between locations. |
| 93 | + |
| 94 | +To add networks, add the `networks` field to the `agent-provisioning`'s `attributes` object and set `"roaming_mode": true`. |
| 95 | +You may need to add the `agent-provisioning` object to the `agent` object if it doesn't already exist. |
| 96 | + |
| 97 | +{{< alert title="Note" color="note" >}} |
| 98 | +If you are using the Viam app to add networks to a machine’s configuration, the machine will need to be connected to the internet to retrieve the configuration information containing the network credentials before it can use them. |
| 99 | +{{< /alert >}} |
| 100 | + |
| 101 | +The following configuration defines the connection information and credentials for two WiFi networks named `fallbackNetOne` and `fallbackNetTwo`. |
| 102 | +`viam-agent` will try to connect to `fallbackNetOne` first, since its priority is highest. |
| 103 | +If the `fallbackNetOne` is not available or the machine can connect but internet is not available, `viam-agent` will then attempt to connect to `fallbackNetTwo`. |
| 104 | + |
| 105 | +```json |
| 106 | +"agent": { |
| 107 | + "agent-provisioning": { |
| 108 | + ... |
| 109 | + "attributes": { |
| 110 | + "roaming_mode": true, |
| 111 | + "networks": [ |
| 112 | + { |
| 113 | + "type": "wifi", |
| 114 | + "ssid": "fallbackNetOne", |
| 115 | + "psk": "myFirstPassword", |
| 116 | + "priority": 30 |
| 117 | + }, |
| 118 | + { |
| 119 | + "type": "wifi", |
| 120 | + "ssid": "fallbackNetTwo", |
| 121 | + "psk": "mySecondPassword", |
| 122 | + "priority": 10 |
| 123 | + } |
| 124 | + ] |
| 125 | + } |
| 126 | + } |
| 127 | +} |
| 128 | +``` |
| 129 | + |
| 130 | +For complete reference information, see [viam-agent](/configure/agent/#networks). |
| 131 | + |
| 132 | +### Example 2 |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | +## Configure operating system logging |
| 137 | + |
| 138 | +By default, the operating system defaults determine the disk space that `journald` uses to persist logs. |
| 139 | +To adjust these settings update the `"agent"` value in the machine's JSON configuration. |
| 140 | + |
| 141 | +For complete reference information, see [viam-agent](/configure/agent/#agent-syscfg). |
| 142 | + |
| 143 | +### Set the maximum disk space |
| 144 | + |
| 145 | +To set the maximum disk space `journald` will use to persist logs, add the `system_max_use` field to the `agent-syscfg`'s `attributes` object. |
| 146 | +You may need to add the `agent-syscfg` object to the `agent` object if it doesn't already exist. |
| 147 | + |
| 148 | +The configured values will take precedence over operating system defaults. |
| 149 | + |
| 150 | +```json |
| 151 | +"agent": { |
| 152 | + "agent-syscfg": { |
| 153 | + "release_channel": "stable", |
| 154 | + "attributes": { |
| 155 | + "logging": { |
| 156 | + "system_max_use": "512M" |
| 157 | + } |
| 158 | + } |
| 159 | + } |
| 160 | +} |
| 161 | +``` |
| 162 | + |
| 163 | +### Set the runtime space limit space |
| 164 | + |
| 165 | +To set the temporary space limit for logs, add the `runtime_max_use` field to the `agent-syscfg`'s `attributes` object. |
| 166 | +You may need to add the `agent-syscfg` object to the `agent` object if it doesn't already exist. |
| 167 | + |
| 168 | +The configured values will take precedence over operating system defaults. |
| 169 | + |
| 170 | +```json |
| 171 | +"agent": { |
| 172 | + "agent-syscfg": { |
| 173 | + "release_channel": "stable", |
| 174 | + "attributes": { |
| 175 | + "logging": { |
| 176 | + "runtime_max_use": "512M" |
| 177 | + } |
| 178 | + } |
| 179 | + } |
| 180 | +} |
| 181 | +``` |
| 182 | + |
| 183 | +### Use the default operating system settings |
| 184 | + |
| 185 | +This configuration does not modify the OS-level logging configuration. |
| 186 | +The operating system defaults will be used: |
| 187 | + |
| 188 | +```json |
| 189 | +"agent": { |
| 190 | + "agent-syscfg": { |
| 191 | + "release_channel": "stable", |
| 192 | + "attributes": { |
| 193 | + "logging": { |
| 194 | + "disable": true |
| 195 | + } |
| 196 | + } |
| 197 | + } |
| 198 | +} |
| 199 | +``` |
0 commit comments