3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00
guix/gnu/services
Maxim Cournoyer 85b4dabd94
services: jami: Modernize to adjust to Shepherd 0.9+ changes.
This partially fixes <https://issues.guix.gnu.org/54786>, allowing the 'jami'
and 'jami-provisioning' system tests to pass again.

In version 0.9.0, Shepherd constructors are now run concurrently, via
cooperative scheduling (Guile Fibers).  The Jami service previously relied on
blocking sleeps while polling for D-Bus services to become ready after forking
a process; this wouldn't work anymore since while blocking the service process
wouldn't be given the chance to finish starting.  The new reliance on Fibers
in Shepherd's fork+exec-command in the helper 'send-dbus' procedure also meant
that it wouldn't work outside of Shepherd anymore.  Finally, the
'start-service' Shepherd procedure used in the test suite would cause the Jami
daemon to be spawned multiple times (a bug introduced in Shepherd 0.9.0).

To fix/simplify these problems, this change does the following:

1. Use the Guile AC/D-Bus library for D-Bus communication, which simplify
things, such as avoiding the need to fork 'dbus-send' processes.

2. The non-blocking 'sleep' version of Fiber is used for the 'with-retries'
waiting syntax.

3. A 'dbus' package variant is used to adjust the session bus configuration,
tailoring it for the use case at hand.

4. Avoid start-service in the tests, preferring 'jami-service-available?' for
now.

* gnu/build/jami-service.scm (parse-dbus-reply, strip-quotes)
(deserialize-item, serialize-boolean, dbus-dict->alist)
(dbus-array->list, parse-account-ids, parse-account-details)
(parse-contacts): Delete procedures.
(%send-dbus-binary, %send-dbus-bus, %send-dbus-user, %send-dbus-group)
(%send-dbus-debug): Delete parameters.
(jami-service-running?): New procedure.
(send-dbus/configuration-manager): Rename to...
(call-configuration-manager-method): ... this.  Turn METHOD into a positional
argument.  Turn ARGUMENTS into an optional argument.  Invoke
`call-dbus-method' instead of `send-dbus', adjusting callers accordingly.
(get-account-ids, id->account-details, id->account-details)
(id->volatile-account-details, username->id, add-account remove-account)
(username->contacts, remove-contact, add-contact, set-account-details)
(set-all-moderators, username->all-moderators?, username->moderators)
(set-moderator): Adjust accordingly.
(with-retries, send-dbus, dbus-available-services)
(dbus-service-available?): Move to ...
* gnu/build/dbus-service.scm: ... this new module.
(send-dbus): Rewrite to use the Guile AC/D-Bus library.
(%dbus-query-timeout, sleep*): New variables.
(%current-dbus-connection): New parameter.
(initialize-dbus-connection!, argument->signature-type)
(call-dbus-method): New procedures.
(dbus-available-services): Adjust accordingly.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register new module.
* gnu/packages/glib.scm (dbus-for-jami): New variable.
* gnu/services/telephony.scm: (jami-configuration)[dbus]: Default to
dbus-for-jami.
(jami-dbus-session-activation): Write a D-Bus daemon configuration file at
'/var/run/jami/session-local.conf'.
(jami-shepherd-services): Add the closure of guile-ac-d-bus and guile-fibers
as extensions.  Adjust imported modules.  Remove no longer used parameters.
<jami-dbus-session>: Use a PID file, avoiding the need for the manual
synchronization.
<jami>:  Set DBUS_SESSION_BUS_ADDRESS environment variable.  Poll using
'jami-service-available?' instead of 'dbus-service-available?'.
* gnu/tests/telephony.scm (run-jami-test): Add needed Guile extensions.  Set
DBUS_SESSION_BUS_ADDRESS environment variable.  Adjust all tests to use
'jami-service-available?' to determine if the service is started rather than
the now problematic Shepherd's 'start-service'.
2022-06-10 23:52:33 -04:00
..
admin.scm services: rottlog: Keep fewer "guix-daemon.log" files. 2022-04-09 00:30:40 +02:00
audio.scm services: mpd: Make /var/run/mpd/USER user-owned. 2020-12-06 23:18:08 +01:00
auditd.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
authentication.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
avahi.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
base.scm services: syslogd: Do not fsync at each line. 2022-06-06 22:43:31 +02:00
certbot.scm services: certbot: Add option to use CSR file. 2021-06-24 18:19:39 -04:00
cgit.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
ci.scm services: laminar: Set LAMINAR_BIND_RPC environment variable. 2022-01-11 11:47:42 +05:30
configuration.scm services: configuration: Fix interpose implementation. 2021-11-01 17:46:49 +03:00
cuirass.scm services: cuirass: Also rotate the web log. 2022-02-17 13:39:02 -05:00
cups.scm Merge remote-tracking branch 'origin/master' into core-updates-frozen 2021-12-05 19:17:41 +01:00
databases.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
dbus.scm services: dbus: Increase auth_timeout value to 5 minutes. 2022-02-19 01:37:42 -05:00
desktop.scm services: elogind: When started by dbus-daemon, wait for the Shepherd service. 2022-05-28 23:23:36 +02:00
dict.scm services: Make sure Shepherd destructors match constructors. 2022-05-02 17:57:30 +02:00
dns.scm services: ddclient: No need to import (ice-9 rdelim) from the host. 2022-06-04 00:11:44 +02:00
docker.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
file-sharing.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
games.scm services: wesnothd: Use 'least-authority-wrapper'. 2022-05-01 21:30:36 +02:00
ganeti.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
getmail.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
guix.scm services: guix-data-service: Increase timeout for service start. 2022-06-05 23:35:31 +02:00
herd.scm services: herd: Add 'wait-for-service'. 2022-05-28 23:23:36 +02:00
hurd.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
kerberos.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
linux.scm services: Add a service for rasdaemon. 2021-04-24 12:30:01 -04:00
lirc.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
mail.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
mcron.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
messaging.scm services: bitlbee: Run under a UTF-8 locale. 2022-06-04 00:11:45 +02:00
monitoring.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
networking.scm gnu: Remove wicd. 2022-05-31 14:53:42 -04:00
nfs.scm services: pipefs: Correctly handle lack of extensions. 2022-05-03 18:02:27 +02:00
nix.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
pam-mount.scm services: pam-mount: Add support for sddm login manager. 2022-01-17 00:13:46 +01:00
pm.scm services: thermald: Add 'adaptive?' field. 2022-03-20 16:40:22 +01:00
rsync.scm services: rsync: Allow configuring several rsync "modules". 2021-12-21 15:47:03 +01:00
science.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
sddm.scm services: SDDM: Wait for elogind before starting. 2020-11-18 22:31:32 +01:00
security-token.scm services: pcscd: Fix daemon signal handling. 2021-07-03 20:13:42 +02:00
shepherd.scm services: shepherd: Do not unload transient services. 2022-04-10 00:17:40 +02:00
sound.scm services: pulseaudio: Deploy the configuration files to /etc/pulse. 2022-02-26 09:03:01 -05:00
spice.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
ssh.scm services: openssh: Remove authorized_keys.d before copying the new one. 2022-05-26 17:00:33 +02:00
syncthing.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
sysctl.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
telephony.scm services: jami: Modernize to adjust to Shepherd 0.9+ changes. 2022-06-10 23:52:33 -04:00
version-control.scm services: Accept <inferior-package>s in lieu of <package>s. 2021-11-30 01:08:55 +01:00
virtualization.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
vpn.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
web.scm services: Add missing 'description' fields. 2022-04-29 18:07:16 +02:00
xorg.scm services: xorg: Remove xf86-input-synaptics from %default-xorg-modules. 2022-03-25 18:42:14 +01:00