From c7784f206355b19b7bb1607247301dc27766e5b0 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Thu, 18 Jun 2026 14:51:40 +0800 Subject: [PATCH] fix: restart opencode acp through launchd --- roles/vhosts/acp_server_opencode/handlers/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/roles/vhosts/acp_server_opencode/handlers/main.yml b/roles/vhosts/acp_server_opencode/handlers/main.yml index 4944278..a683796 100644 --- a/roles/vhosts/acp_server_opencode/handlers/main.yml +++ b/roles/vhosts/acp_server_opencode/handlers/main.yml @@ -3,8 +3,21 @@ ansible.builtin.service: name: caddy state: reloaded + when: ansible_os_family != 'Darwin' - name: Restart acp opencode ansible.builtin.service: name: "{{ acp_opencode_service_name }}" state: restarted + when: ansible_os_family != 'Darwin' + +- name: Restart acp opencode on macOS + ansible.builtin.command: "launchctl stop plus.svc.xworkspace.acp.opencode" + register: launchctl_stop + failed_when: false + changed_when: false + notify: Start acp opencode on macOS + +- name: Start acp opencode on macOS + ansible.builtin.command: "launchctl start plus.svc.xworkspace.acp.opencode" + changed_when: false