Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
33 changes: 32 additions & 1 deletion docs/manage/reference/viam-agent/manage-viam-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,45 @@ You can only restore this file if you have access to the machine configuration.
sudo launchctl kickstart system/com.viam.agent
```

If the service fails to start, make sure it is bootstrapped. The following command will
print an error message if the service is NOT bootstrapped.

```sh {class="command-line" data-prompt="$"}
sudo launchctl print system/com.viam.agent
```

The following command will bootstrap the service.

```sh {class="command-line" data-prompt="$"}
sudo launchctl bootstrap system /Library/LaunchDaemons/com.viam.agent.plist
```

If the service STILL fails to start, ensure that it is enabled. The following command
will enable the service.

```sh {class="command-line" data-prompt="$"}
sudo launchctl enable system/com.viam.agent
```

- To stop `viam-agent`:

{{< alert title="Alert" color="note" >}}
When you stop `viam-agent`, the agent will stop `viam-server` as well.
{{< /alert >}}

`sudo launchctl kill` and `sudo launchctl stop` will NOT fully stop `viam-agent`, as
launchd will automatically resurrect it. You can use the following to "boot out" the
service and fully stop it.

```sh {class="command-line" data-prompt="$"}
sudo launchctl bootout system/com.viam.agent
```

If you would like to start `viam-agent` again after this command, you will need to
bootstrap it again.

```sh {class="command-line" data-prompt="$"}
sudo launchctl kill SIGTERM system/com.viam.agent
sudo launchctl bootstrap system /Library/LaunchDaemons/com.viam.agent.plist
```

- To completely uninstall `viam-agent` and `viam-server`, run the following command:
Expand Down
14 changes: 3 additions & 11 deletions docs/operate/reference/viam-server/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,9 @@ brew tap viamrobotics/brews && brew install viam-server

The `viam-server` binary is installed at <FILE>/opt/homebrew/bin/viam-server</FILE>.

You can optionally run `viam-server` as a background service with Homebrew:

1. Place your machine configuration at <FILE>/opt/homebrew/etc/viam.json</FILE>.

1. Start the service with:

```sh {class="command-line" data-prompt="$" data-output="5-10"}
brew services start viam-server
```

For more information about brew services, run `brew services --help`.
The brew installation of `viam-server` CANNOT be run as a system service in the
background. If you would like to run `viam-server` in the background, install
[`viam-agent`](/manage/reference/viam-agent/) instead.

{{% /tab %}}
{{% tab name="Windows Subsystem for Linux (WSL)" %}}
Expand Down
32 changes: 3 additions & 29 deletions docs/operate/reference/viam-server/manage-viam-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,29 +127,9 @@ Type **Ctrl + C** on your keyboard within the terminal session where you are run

### Run as a system service

Installing `viam-server` as a system service is not recommended for most use cases on macOS.
However, if you are looking to create a machine that runs on macOS and you want it to run `viam-server` automatically when your macOS system boots, then you will need to run `viam-server` as a service.

Once you have [installed `viam-server`](/operate/install/setup/) on your macOS computer, use the following commands to control the service.
These commands require that you store your machine cloud credentials file at <file>/opt/homebrew/etc/viam.json</file>.

#### Start

```sh {class="command-line" data-prompt="$"}
brew services start viam-server
```

#### Stop

```sh {class="command-line" data-prompt="$"}
brew services stop viam-server
```

#### Restart

```sh {class="command-line" data-prompt="$"}
brew services restart viam-server
```
The brew installation of `viam-server` CANNOT be run as a system service in the
background. If you would like to run `viam-server` in the background, install
[`viam-agent`](/manage/reference/viam-agent/) instead.

{{% /tab %}}
{{< /tabs >}}
Expand Down Expand Up @@ -326,12 +306,6 @@ grep viam-server /var/log/syslog

When running `viam-server` on macOS, log messages are written to standard out (`stdout`) in the same terminal session you started `viam-server` in.

You can also access the local `viam-server` log file using the following command:

```sh {class="command-line" data-prompt="$"}
cat $(brew --prefix)/var/log/viam.log
```

{{% /tab %}}
{{< /tabs >}}

Expand Down
Loading