From 393ff77eaf1e52549425b94a9b0923f262075d11 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 7 Oct 2026 00:05:39 -0700 Subject: [PATCH] zeroclaw, add runit script for web daemon. --- tasks/workstation/linux/software/zeroclaw.yml | 55 +++++++++++++++---- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/tasks/workstation/linux/software/zeroclaw.yml b/tasks/workstation/linux/software/zeroclaw.yml index e4c0b52..59c1dbc 100644 --- a/tasks/workstation/linux/software/zeroclaw.yml +++ b/tasks/workstation/linux/software/zeroclaw.yml @@ -112,6 +112,41 @@ state: started enabled: true + - name: Workstation | Linux | Software | ZeroClaw | zeroclaw | runit | Script + ansible.builtin.copy: + content: | + #!/bin/sh -e + # Allow using the ZeroClaw frontend. + exec 2>&1 + exec chpst -u {{ user }} zeroclaw daemon + dest: "{{ zeroclaw_runit_start }}" + mode: "0755" + when: ansible_service_mgr == "runit" + + - name: Workstation | Linux | Software | ZeroClaw | zeroclaw | runit | Log | Script + ansible.builtin.copy: + content: | + #!/bin/sh -e + exec svlogd -tt {{ zeroclaw_runit_log_dest }} + dest: "{{ zeroclaw_runit_start }}" + mode: "0755" + when: ansible_service_mgr == "runit" + + - name: Workstation | Linux | Software | ZeroClaw | zeroclaw | runit | Log | Config + ansible.builtin.copy: + content: | + s1000000 # rotate at 1 MB + n5 # keep 5 old files + dest: "{{ zeroclaw_runit_log_config }}" + mode: "0755" + when: ansible_service_mgr == "runit" + + - name: Workstation | Linux | Software | ZeroClaw | zeroclaw | Enable + ansible.builtin.service: + name: "{{ zeroclaw }}" + state: started + enabled: true + - name: Workstation | Linux | Software | ZeroClaw | ollama | Wait ansible.builtin.uri: url: http://127.0.0.1:11434/api/version @@ -162,17 +197,15 @@ become: true become_user: "{{ user }}" - #- name: Workstation | Linux | Software | ZeroClaw | zeroclaw | Config - # ansible.builtin.copy: - # src: files/settings/zeroclaw.config.toml - # dest: "{{ user_user.home }}/.zeroclaw/config.toml" - # owner: "{{ user }}" - # mode: "0644" - - - name: Workstation | Linux | Software | ZeroClaw | zeroclaw | Test - ansible.builtin.debug: - msg: TBD - ### zeroclaw agent -m "Hello!" # quick test + - name: Workstation | Linux | Software | ZeroClaw | zeroclaw | Wait + ansible.builtin.uri: + url: http://127.0.0.1:42617/api/version + status_code: 200 + timeout: 5 + register: health + until: health.status == 200 + retries: 12 + delay: 5 ### Nah, run on command instead of as daemon, otherwise will eat power. ###- name: Workstation | Linux | Software | ZeroClaw | Init Scripts | zeroclaw