Mac: Podman VM job needs AbandonProcessGroup

`podman machine start` exits once the VM is up, and launchd then killed the
VM processes left in the job's process group, so a VM started by the job
stopped ~20 s later. Keep them with AbandonProcessGroup, and reload the job
when its plist changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-11 07:29:08 -07:00
1 parent 4bdb89885c
commit 3036fa2d74
3 files changed
+15 -4

No files matched your search

+3 -2
View File
@@ -32,8 +32,9 @@ Manages cogitator-02, an Apple Silicon Mac on the tailnet (`mac.yml`,
refuses it without `--force` (hermes-agent #140221).
- **Podman VM** (tag `podman`): a launchd job (`local.podman-machine`) that
starts the VM running Hermes's sandbox at login, and `podman_machine_memory`
for its size. A resize stops the VM and starts it again through that job
(a VM started from an Ansible task is stopped when the task ends).
for its size. A resize stops the VM and starts it again through that job.
The job needs `AbandonProcessGroup`, or launchd kills the VM as soon as
`podman machine start` exits.
- **Hermes cron jobs** (tag `hermes-cron`): `hermes_cron_jobs` in
`group_vars/mac/main.yml`, with their scripts from `files/hermes-scripts/`
copied to `~/.hermes/scripts/`. Missing jobs are created; existing ones are
+8 -2
View File
@@ -1,11 +1,17 @@
# The Podman VM runs Hermes's sandbox containers. A launchd job starts it at
# login, and starts it again after a resize: a VM started from an Ansible task
# gets stopped when the task ends.
# login, and starts it again after a resize.
- name: Podman VM launchd job
ansible.builtin.template:
src: podman-machine.plist.j2
dest: "{{ ansible_user_dir }}/Library/LaunchAgents/{{ podman_machine_label }}.plist"
mode: "0644"
register: podman_plist
- name: Unload the old Podman VM job definition
ansible.builtin.command:
argv: [launchctl, bootout, "gui/{{ ansible_user_uid }}/{{ podman_machine_label }}"]
when: podman_plist is changed
failed_when: false
- name: Check the Podman VM job is loaded
ansible.builtin.command:
@@ -21,6 +21,10 @@
<true/>
<key>KeepAlive</key>
<false/>
<!-- `podman machine start` exits once the VM is up; without this launchd
kills the VM processes it leaves behind. -->
<key>AbandonProcessGroup</key>
<true/>
<key>StandardOutPath</key>
<string>{{ ansible_user_dir }}/Library/Logs/podman-machine.log</string>
<key>StandardErrorPath</key>