imsd/packaging/imsd-ofonod.service

31 lines
1.3 KiB
SYSTEMD
Raw Normal View History

# SPDX-License-Identifier: GPL-3.0-only
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
[Unit]
Description=oFono-compatible GNOME Calls backend for imsd
Documentation=https://forgejo.catcrafts.net/Catcrafts/imsd
# org.ofono is a system-bus name only root may own (org.ofono.conf), so this
# is a system service run as root: imsd admits the calls it forwards as
# root's (it has asked polkit about its own caller), and its start hook
# restarts GNOME Calls in the users' own managers. Only enable it on a
# GNOME/Phosh session
# — Plasma Mobile uses imsd-dialerd instead. Both may run at once (different
# buses, different consumers), but a real ofonod must not.
Conflicts=ofono.service
After=imsd.service
Wants=imsd.service
[Service]
Type=simple
# EMERGENCY_NUMBERS only, and only so the oFono EmergencyNumbers property
# matches imsd's configuration; imsd itself owns emergency classification.
EnvironmentFile=-/etc/imsd.env
ExecStart=/usr/bin/imsd-ofonod
packaging: restart imsd and imsd-ofonod on upgrade An upgrade left the old imsd and imsd-ofonod running until they were next restarted, while a changed bus policy is live the moment apk writes it: dbus-broker-launch reloads on its own. A policy that relies on a check inside the daemons would face the old daemons in between. Mark imsd.service and imsd-ofonod.service needs-restart in post-upgrade scripts; the systemd trigger restarts them once the transaction is done (enqueue-marked). A call in progress ends. The same scripts run as post-install: `apk del` removes a package's files and leaves its daemon running, so a later `apk add` of the package is this upgrade for that daemon — and apk runs the post-install script, not post-upgrade, for a package it adds. GNOME Calls 50.0 dials nothing after imsd-ofonod restarts under it until it restarts too, so imsd-ofonod's ExecStartPost restarts the Calls daemon of each user running one — not at the unit's first start since boot, when a Calls that runs already is left alone. A daemon older than 0.3.10 kept its bring-up throttle wait in memory only, so a restart lost it. imsd's post-upgrade records that daemon's invocation, and imsd-handover.sh, an ExecStartPre after ims-pdn-up.sh, reads the invocation's journal and, while the fresh-SA throttle's wait it finds there still runs (`spi-s=0`; the old daemon's other deferrals are not handed over), writes what is left of it to the holds file when this start's LOCAL is the address the wait was earned on, or when that address cannot be read; when LOCAL is another address, only the verdict that the old registration is gone. Tested on the dev phone (KPN) in builds of this series; not every path has run there.
2026-10-04 00:09:37 +02:00
# GNOME Calls keeps a stale modem when org.ofono restarts and dials nothing
# until it restarts too: restart the Calls daemon of each user running one
ExecStartPost=-/usr/libexec/imsd-ofono-restart-calls.sh
# it holds no call state of its own — imsd is re-queried on every reconnect
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target