You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
daemon: Add socket activation via /run/rpm-ostreed.socket
For historical reasons, the daemon ends up doing a lot of
initialization before even claiming the DBus name. For example,
it calls `ostree_sysroot_load()`. We also end up scanning
the RPM database, and actually parse all the GPG keys
in `/etc/pki/rpm-gpg` etc.
This causes two related problems:
- By doing all this work before claiming the bus name, we
race against the (pretty low) DBus service timeout of 25s.
- If something hard fails at initialization, the client can't
easily see the error because it just appears in the systemd
journal. The client will just see a service timeout.
The solution to this is to adopt systemd socket activation.
There's a new `rpm-ostreed.socket` and the daemon can be activated
that way.
The client (when run as root, the socket is only accessible to root
right now) connects, which will activate the daemon and attempt
initialization - without claiming the DBus name yet.
If something goes wrong here, the daemon will reply to the client
that activated it with the error, and then also exit with failure.
On success, everything continues as normal, including claiming
the DBus name.
Note that this also logically replaces the code that does explicit
`systemctl start rpm-ostreed` invocations.
After this patch:
```
$ systemctl stop rpm-ostreed
$ umount /boot
$ rpm-ostree status
error: Couldn't start daemon: Error setting up sysroot: loading sysroot: Unexpected state: /run/ostree-booted found, but no /boot/loader directory
```
Co-authored-by: Colin Walters <[email protected]>
0 commit comments