Browse Source

asterisk: create /var/lib/quadlets/asterisk from the package, not tmpfiles

On the first boot of Fedora CoreOS, rpm-ostree applies qemu-guest-agent
live and runs "systemd-tmpfiles --create --prefix=/var" after the
containers have started. The "d" line reset the SELinux label of the
directory Podman had relabeled, and every REGISTER then failed with
"ast_db_put: SQL logic error". The package now creates the directory and
its spool and log sub-directories, once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UJKweojs6NK5svZwRgQjQH
main
Nicolas Massé 2 weeks ago
parent
commit
7addbfdc27
  1. 8
      cookbooks/asterisk/Makefile
  2. 16
      cookbooks/asterisk/tmpfiles.d/asterisk.conf

8
cookbooks/asterisk/Makefile

@ -6,5 +6,13 @@
PROJECT_UID = 10036 PROJECT_UID = 10036
PROJECT_GID = 10000 PROJECT_GID = 10000
# Spool and logs of Asterisk, created by the package and not by systemd-tmpfiles:
# see the comment in tmpfiles.d/asterisk.conf.
TARGET_FILES += $(TARGET_CHROOT)/var/lib/quadlets/asterisk/spool
TARGET_FILES += $(TARGET_CHROOT)/var/lib/quadlets/asterisk/log
# Include common Makefile # Include common Makefile
include ../../scripts/common.mk include ../../scripts/common.mk
$(TARGET_CHROOT)/var/lib/quadlets/asterisk/spool $(TARGET_CHROOT)/var/lib/quadlets/asterisk/log: $(TARGET_CHROOT)/var/lib/quadlets/asterisk
install -d -m 0750 -o $(PROJECT_UID) -g $(PROJECT_GID) $@

16
cookbooks/asterisk/tmpfiles.d/asterisk.conf

@ -1,11 +1,15 @@
# Internal database, spool and logs of Asterisk. Not precious: no voicemail,
# no recordings.
d /var/lib/quadlets/asterisk 0750 10036 10000 -
d /var/lib/quadlets/asterisk/spool 0750 10036 10000 -
d /var/lib/quadlets/asterisk/log 0750 10036 10000 -
# Provisioning files of the phones, served over TFTP. Operator-provided, on the # Provisioning files of the phones, served over TFTP. Operator-provided, on the
# precious-data mount so that the host can write them. The "$" marks it for # precious-data mount so that the host can write them. The "$" marks it for
# removal on `systemd-tmpfiles --purge` (i.e. `make uninstall`). # removal on `systemd-tmpfiles --purge` (i.e. `make uninstall`).
#
# /var/lib/quadlets/asterisk is NOT declared here, and must not be. The package
# creates it, once. A "d" line adjusts the directory again at every run of
# systemd-tmpfiles, and resets its SELinux label to var_lib_t on the way. Such a
# run happens AFTER the containers start on the first boot of a Fedora CoreOS
# machine: rpm-ostree applies the qemu-guest-agent package live, then runs
# "systemd-tmpfiles --create --prefix=/var". Asterisk then loses access to the
# directory Podman had just relabeled, and every REGISTER fails with
# "ast_db_put: SQL logic error". Measured on 2026-10-25. The virtiofs mount is
# not affected: its label is fixed by the mount.
d$ /var/lib/virtiofs/data/asterisk 0750 10036 10000 - d$ /var/lib/virtiofs/data/asterisk 0750 10036 10000 -
d$ /var/lib/virtiofs/data/asterisk/tftp 0750 10036 10000 - d$ /var/lib/virtiofs/data/asterisk/tftp 0750 10036 10000 -

Loading…
Cancel
Save