Skip to content

Commit

Permalink
opentrons-systemd-units: add a systemd service to clear the fontconfi…
Browse files Browse the repository at this point in the history
…g cache. (#186)
  • Loading branch information
vegano1 authored Jan 13, 2025
1 parent f5370cb commit 525434b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Service]
Type=oneshot
ExecStart=/usr/bin/ot-clear-fontconfig-cache

[Install]
WantedBy=basic.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

echo "Clear Fontconfig cache."
rm -rf /var/cache/fontconfig/*
fc-cache -rf
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,33 @@ FILESEXTRAPATHS:prepend = "${THISDIR}/files:"
SRC_URI += "\
file://var-log-journal.service \
file://opentrons-commit-machine-id.service \
file://opentrons-clear-fontconfig-cache.service \
file://ot-commit-machine-id \
file://ot-clear-fontconfig-cache \
"

SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} += "var-log-journal.service"
SYSTEMD_SERVICE:${PN} += "opentrons-commit-machine-id.service"
SYSTEMD_SERVICE:${PN} += "opentrons-clear-fontconfig-cache.service"
SYSTEMD_PACKAGES = "${PN}"

FILES:${PN} += "\
${systemd_system_unitdir}/var-log-journal.service \
${systemd_system_unitdir}/opentrons-commit-machine-id.service \
${systemd_system_unitdir}/opentrons-clear-fontconfig-cache.service \
${bindir}/ot-commit-machine-id \
${bindir}/ot-clear-fontconfig-cache \
"

do_install() {
install -d ${D}/${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/var-log-journal.service ${D}/${systemd_system_unitdir}/var-log-journal.service
install -m 0644 ${WORKDIR}/opentrons-commit-machine-id.service ${D}/${systemd_system_unitdir}/opentrons-commit-machine-id.service
install -m 0644 ${WORKDIR}/var-log-journal.service ${D}/${systemd_system_unitdir}/
install -m 0644 ${WORKDIR}/opentrons-commit-machine-id.service ${D}/${systemd_system_unitdir}/
install -m 0644 ${WORKDIR}/opentrons-clear-fontconfig-cache.service ${D}/${systemd_system_unitdir}/

# install supporting files
install -d ${D}/${bindir}
install -m 0744 ${WORKDIR}/ot-commit-machine-id ${D}/${bindir}/ot-commit-machine-id
install -m 0744 ${WORKDIR}/ot-commit-machine-id ${D}/${bindir}/
install -m 0744 ${WORKDIR}/ot-clear-fontconfig-cache ${D}/${bindir}/
}

0 comments on commit 525434b

Please sign in to comment.