nixpkgs/nixos/modules/services
Luflosi d4fcb44dcc
nixos/kubo: fix potential panic on startup
This fixes a panic of the kubo daemon which could occur under certain conditions when the daemon was starting.
It was caused by the `ipfs.service` unit not depending on the `ipfs-api.socket` and `ipfs-gateway.socket` units with `Wants=`. This allows the `ipfs.service` to be started manually or by `nixos-rebuild` without the sockets being set up before that. When that happens, the daemon won't know about these sockets and will only use what is set in `services.kubo.settings.Addresses.Gateway` and `services.kubo.settings.Addresses.API`. By default the `API` is an empty list in NixOS though. The daemon doesn't like this at all and panics on startup, see https://github.com/ipfs/kubo/issues/10056.
With this commit, starting `ipfs.service` will first set up the two sockets before starting the actual service.
Adding the `Sockets=` option implicitly adds a `Wants=` for the sockets and this is exactly what we need. See https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Implicit%20Dependencies . This can be checked with `systemctl show ipfs.service`.

This should probably be upstreamed to the unit file in the Kubo repo.

The problem can be reproduced in the following way:
- Add `services.kubo.enable = true` to `/etc/nixos/configuration.nix`
- `sudo nixos-rebuild switch` (this may already fail, not sure why it's not deterministic for me)
- `sudo systemctl stop ipfs-api.socket`
- `sudo systemctl stop ipfs-gateway.socket`
- `sudo systemctl stop ipfs.service`
- `sudo systemctl start ipfs.service`

Fixes #248447.
2023-12-15 23:36:08 +01:00
..
admin treewide: use mkPackageOption 2023-11-27 01:28:36 +01:00
amqp treewide: use mkPackageOption 2023-11-27 01:28:36 +01:00
audio nixos/wyoming/{faster-whisper,piper}: hook up enable option 2023-12-07 22:27:15 +01:00
backup Merge pull request #270084 from Atemu/nixos/snapraid-top-level 2023-12-14 14:51:04 +01:00
blockchain/ethereum treewide: replace mkPackageOptionMD with mkPackageOption 2023-11-30 19:03:14 +01:00
cluster Merge pull request #256737 from illustris/spark 2023-12-07 04:24:16 +01:00
computing Merge pull request #261702 from h7x4/replace-mkoption-with-mkpackageoption 2023-11-30 02:49:30 +01:00
continuous-integration nixos/jenkins: set StateDirectory if home is /var/lib/jenkins 2023-12-13 15:15:50 +02:00
databases Merge pull request #257504 from SuperSandro2000/postgres-doc 2023-12-15 00:43:13 +01:00
desktops flatpak: 1.14.4 → 1.14.5 2023-12-11 23:58:03 +08:00
development Merge pull request #269469 from NetaliDev/zammad-update 2023-12-05 09:29:51 +01:00
display-managers Merge pull request #268497 from katexochen/greetd/tuigreet-dir 2023-12-07 10:04:09 +01:00
editors Merge pull request #270096 from slotThe/emacs/192019-2 2023-12-01 01:31:04 -06:00
finance treewide: use mkPackageOption 2023-11-27 01:28:36 +01:00
games Merge pull request #271289 from Luflosi/teeworlds-module-reduce-closure 2023-12-07 10:19:11 +01:00
hardware nixos/udev: allow /bin/sh in udev rules 2023-12-14 19:14:13 +02:00
home-automation Merge pull request #272576 from NixOS/home-assistant 2023-12-10 14:51:43 +01:00
logging nixos/vector: align service restart policy with upstream 2023-12-06 19:15:11 +00:00
mail Merge pull request #266746 from serpent213/patch-2 2023-12-01 15:50:05 +11:00
matrix nixos/matrix-synapse: update broken link to redis related docs 2023-12-13 18:02:47 -05:00
misc nixos/guix: remove Service.MemoryDenyWriteExecute for GC service 2023-12-12 10:19:37 +08:00
monitoring Merge pull request #253184 from tilpner/prometheus-headers 2023-12-13 21:53:52 +01:00
network-filesystems nixos/kubo: fix potential panic on startup 2023-12-15 23:36:08 +01:00
networking Merge pull request #264869 from h7x4/nixos-module-cleanup-quicktun 2023-12-15 20:14:39 +01:00
printing nixos/printing: Fix openFirewall option 2023-11-07 10:21:48 +01:00
scheduling treewide: use optionalString instead of 'then ""' 2023-06-24 20:19:19 +02:00
search nixos/hound: adopt, rework, cleanup (#268983) 2023-12-05 15:59:26 +01:00
security nixos/clamav: add scanner service 2023-12-05 22:53:35 +00:00
system treewide: replace mkPackageOptionMD with mkPackageOption 2023-11-30 19:03:14 +01:00
torrent nixos/sysctl: use highest value on conflict for net.core.wmem_max 2023-12-15 04:43:57 +01:00
tracing nixos/tempo: add extraFlags option 2023-08-14 18:07:24 +02:00
ttys treewide: rename fonts.fonts to fonts.packages 2023-07-24 17:34:39 +02:00
video treewide: replace mkPackageOptionMD with mkPackageOption 2023-11-30 19:03:14 +01:00
wayland nixos/cage: add environment config 2023-05-28 23:36:22 +02:00
web-apps Merge pull request #273858 from dotlambda/nextcloud28-init 2023-12-15 08:14:15 +01:00
web-servers nixos/caddy: also increase socket send buffer size as recommended by upstream 2023-12-15 04:43:57 +01:00
x11 Merge pull request #266234 from SuperSamus/plasma-dconf-glib 2023-12-05 00:23:29 +03:00