Changeset 12bed59 in Klonkt for scripts/klonkt-refresh-updater.sh
- Timestamp:
- 08/07/2026 04:14:49 PM (5 weeks ago)
- Branches:
- main
- Children:
- f85b2c3
- Parents:
- fa33214
- git-author:
- Robin <roboburr@…> (07/31/2026 02:52:19 PM)
- git-committer:
- Robin <roboburr@…> (08/07/2026 04:14:49 PM)
- File:
-
- 1 edited
-
scripts/klonkt-refresh-updater.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
scripts/klonkt-refresh-updater.sh
rfa33214 r12bed59 59 59 echo "klonkt-update rewritten: branch ${BRANCH}, code ${KLONKT_DIR}, instances under ${DATA_ROOT}" 60 60 61 # On a split install the old single unit must not be startable. `disable` alone 62 # does not stop `systemctl restart klonkt` from starting it, and a resurrected 63 # klonkt.service has no .env (it moved with the data): it falls back to the 64 # defaults and writes a fresh empty database into the checkout. 61 # On a split install the old single unit must not be startable at all. 62 # `disable` is not enough (restart starts a disabled unit anyway) and `mask` 63 # refuses while the real file sits in /etc/systemd/system, the highest-priority 64 # directory. Moving the file aside is what actually works: systemd stops 65 # knowing the unit, so any restart fails loudly instead of quietly starting a 66 # second process that writes an empty database into the checkout. 65 67 SPLIT=0 66 68 for d in "${DATA_ROOT}"/*/; do [ -f "$d/.env" ] && SPLIT=1 && break; done 67 if [ "$SPLIT" = 1 ] && systemctl list-unit-files klonkt.service >/dev/null 2>&1; then 68 if ! systemctl is-enabled klonkt.service 2>/dev/null | grep -q masked; then 69 systemctl stop klonkt.service 2>/dev/null || true 70 systemctl disable klonkt.service 2>/dev/null || true 71 systemctl mask klonkt.service 72 echo "retired klonkt.service: stopped, disabled and masked (unmask to roll back)" 69 if [ "$SPLIT" = 1 ] && [ -f /etc/systemd/system/klonkt.service ]; then 70 systemctl stop klonkt.service 2>/dev/null || true 71 systemctl disable klonkt.service 2>/dev/null || true 72 RETIRED="/etc/systemd/system/klonkt.service.retired-$(date +%Y%m%d%H%M%S)" 73 if mv /etc/systemd/system/klonkt.service "$RETIRED"; then 74 systemctl daemon-reload 75 echo "retired klonkt.service → $RETIRED (move it back + daemon-reload to roll back)" 76 else 77 echo "WARNING: could not move /etc/systemd/system/klonkt.service aside." 78 echo " Until you do, any 'systemctl restart klonkt' starts a second" 79 echo " process that writes an empty database into ${KLONKT_DIR}." 73 80 fi 74 81 fi
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)