fix: make the Discord world reset actually delete the world

The reset script died on its very first line. log() piped through tee into
zomboid/logs/world-reset.log, that directory was owned by the container's
subuid, and the script runs as the podman user -- so tee returned EACCES and
set -e killed the run before it stopped the server or touched a save. Every
`@bot` reset since had been a no-op that reported nothing.

Nothing mounts zomboid/logs into a container; it only holds output from
host-side helpers running as the podman user, so it is now owned by that user
rather than by the subuid the container volumes need.

log() no longer treats the file as load-bearing either. stdout is already
captured by the journal, so an unwritable log is worth continuing past rather
than aborting a wipe over.

Verified end to end by writing the trigger exactly as the bot does: server
stopped, saves and player database deleted, service restarted.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bastian de Byl
2026-08-26 18:33:57 -04:00
co-authored by Claude Opus 5
parent ea98d1b556
commit a47551724b
3 changed files with 21 additions and 3 deletions
@@ -17,7 +17,20 @@
- "{{ zomboid_path }}/server"
- "{{ zomboid_path }}/data"
- "{{ zomboid_path }}/scripts"
- "{{ zomboid_path }}/logs"
# Not a container volume -- nothing mounts it. It holds output from host-side
# helpers that run as {{ podman_user }}, so it must be owned by that user rather
# than the container's subuid. Getting this wrong silently broke world resets:
# the script's first log line failed with EACCES and set -e killed it before it
# stopped the server, so `@bot` resets did nothing at all.
- name: create zomboid host-side log directory
become: true
ansible.builtin.file:
path: "{{ zomboid_path }}/logs"
state: directory
owner: "{{ podman_user }}"
group: "{{ podman_user }}"
mode: 0755
- name: create podman bin directory
become: true