Crates.io | dbus-waiter |
lib.rs | dbus-waiter |
version | 0.2.0 |
source | src |
created_at | 2023-08-09 14:38:00.758612 |
updated_at | 2023-08-09 14:38:00.758612 |
description | Implement readiness notifications for dbus services |
homepage | https://git.sr.ht/~whynothugo/dbus-waiter |
repository | |
max_upload_size | |
id | 940105 |
size | 39,837 |
dbus-waiter is a small program that implements readiness checks for services that take D-Bus names.
dbus-waiter --notify-fd FD --bus-name BUS_NAME PROG...
The following example executes xdg-desktop-portal
, and sends a readiness
notification on file descriptor 3
once the executed process takes the bus
named org.freedesktop.portal.Desktop
:
dbus-waiter \
--notify-fd 3 \
--bus-name org.freedesktop.portal.Desktop \
/usr/libexec/xdg-desktop-portal
The implemented readiness notification mechanism works on both systemd
and
s6
.
If no file descriptor matches the value of --notify-fd
, the output error will
include:
Error: Invalid argument (os error 22)
dbus-waiter first forks. The child process listens to
NameOwnerChanged
events for bus BUS_NAME
. The parent exec
s into PROG
.
When BUS_NAME
has a new owner, if the owner is the parent process, the child
will send a readiness notification and exit.
If a different process takes over the BUS_NAME
, the child will exit
immediately. In this error scenario the readiness check is expected time out,
and the supervisor should kill the parent process.
BUS_NAME
on the specified bus.This project is licensed under the ISC licence. See LICENCE for details.