Files
ansible/roles/pi_musicmouse/handlers/main.yml
Martin Bauer 8c225bbe06 Stop the kiosk coming up blank after every reboot
A reboot kills Chromium rather than closing it, so it writes "exit_type":"Crashed" into
its profile. On the next boot it came up with a restore prompt and a tab stuck for ever
on a blank "Loading..." page - navigation never committed, navigator.serviceWorker was
still undefined, nothing on screen. On a device with a monitor and no keyboard that is
permanent, and the backend was healthy throughout: / answered in 5 ms and /api/library
returned 812 kB the whole time.

--disable-session-crashed-bubble hides the prompt but not the state behind it, and here
the prompt showed anyway. .xinitrc now rewrites exit_type and exited_cleanly before
launching, which is the usual remedy for a kiosk that gets powered off rather than shut
down, and adds --hide-crash-restore-bubble (the current name for the flag).

Verified by rebooting and leaving it alone: the page comes up on its own with its title
and its content.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 17:31:52 +02:00

52 lines
1.6 KiB
YAML

---
- name: Build frontend
ansible.builtin.command:
cmd: npm ci
chdir: "{{ pi_musicmouse_build_cache }}/{{ musicmouse_version | regex_replace('/', '_') }}/web"
delegate_to: localhost
become: false
vars:
ansible_become: false # see the first delegated task in tasks/main.yml
changed_when: true
notify: Compile frontend
- name: Compile frontend
ansible.builtin.command:
cmd: npm run build
chdir: "{{ pi_musicmouse_build_cache }}/{{ musicmouse_version | regex_replace('/', '_') }}/web"
delegate_to: localhost
become: false
vars:
ansible_become: false # see the first delegated task in tasks/main.yml
changed_when: true
notify: Sync frontend
- name: Sync frontend
ansible.posix.synchronize:
src: "{{ pi_musicmouse_build_cache }}/{{ musicmouse_version | regex_replace('/', '_') }}/web/dist/"
dest: /opt/musicmouse/web/dist/
delete: true
notify: Record which commit the frontend was built from
- name: Record which commit the frontend was built from
# After the sync, and outside dist/, which the sync empties of anything it did not
# build. This is what lets the next run tell a current dist from a stale one.
ansible.builtin.copy:
content: "{{ pi_musicmouse_web_checkout.after }}\n"
dest: /opt/musicmouse/web/.built-commit
mode: "0644"
notify: Restart musicmouse
- name: Restart musicmouse
ansible.builtin.systemd:
name: musicmouse
state: restarted
enabled: "yes"
daemon_reload: "yes"
- name: Restart samba
ansible.builtin.systemd:
name: smbd
state: restarted
daemon_reload: true