Skip to content

Correct launchctl commands for MacOS agent management#4833

Merged
benjirewis merged 4 commits intomainfrom
agent-for-macos-launchctl-updates
Mar 12, 2026
Merged

Correct launchctl commands for MacOS agent management#4833
benjirewis merged 4 commits intomainfrom
agent-for-macos-launchctl-updates

Conversation

@benjirewis
Copy link
Member

@benjirewis benjirewis commented Mar 12, 2026

What

Updates launchctl commands for stopping and starting viam-agent on MacOS to include potentially necessary enable/bootstrap/bootout commands.

Why

launchctl is finicky and not as full-featured as systemctl. I have learned that launchctl kill / launchctl stop do NOT fully stop viam-agent since we have KeepAlive: true in the plist that unconditionally restarts viam-agent.

I cannot find a clever/simple to achieve the same functionality as systemd/systemctl: if the process stops for an update or an app-requested restart, resurrect, but if it's stopped with a launchctl command do NOT resurrect. The recommendation online seems to be to bootout your KeepAlive: true service if you want to fully stop it.

KeepAlive does have more expressiveness than just true, but I do not think any of the options are valid paths for us. The PathState key seems interesting, but I cannot come up with a good way to use it.

Link to updated page deploy

https://deploy-preview-4833--viam-docs.netlify.app/manage/reference/viam-agent/manage-viam-agent/

@netlify
Copy link

netlify bot commented Mar 12, 2026

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 4f6eaa0
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/69b2f62ce854f500081cb4d6
😎 Deploy Preview https://deploy-preview-4833--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 44 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Mar 12, 2026
@benjirewis benjirewis requested a review from ale7714 March 12, 2026 16:49
@ale7714
Copy link
Member

ale7714 commented Mar 12, 2026

Copy link
Member

@ale7714 ale7714 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, question about the viam-server service can be address on this PR or a follow up

@benjirewis
Copy link
Member Author

@benjirewis should we remove this https://deploy-preview-4833--viam-docs.netlify.app/operate/reference/viam-server/manage-viam-server/#run-as-a-system-service ?

Yes! Good catch. Removed the two references to starting viam-server in the background as a Homebrew service.

@benjirewis benjirewis merged commit b8f6558 into main Mar 12, 2026
13 checks passed
@benjirewis benjirewis deleted the agent-for-macos-launchctl-updates branch March 12, 2026 17:27
@github-actions
Copy link

🔎💬 Inkeep AI search and chat service is syncing content for source 'Viam Docs'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to build This pull request is marked safe to build from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants