#dbus #dbus-daemon

dbus-launch

A D-Bus daemon launcher

1 unstable release

0.2.0 Aug 30, 2020

#7 in #d-bus

Download history 8/week @ 2024-07-27 45/week @ 2024-08-03 13/week @ 2024-08-10 11/week @ 2024-08-17 99/week @ 2024-08-24 160/week @ 2024-08-31 53/week @ 2024-09-07 47/week @ 2024-09-14 67/week @ 2024-09-21 102/week @ 2024-09-28 67/week @ 2024-10-05 67/week @ 2024-10-12 26/week @ 2024-10-19 33/week @ 2024-10-26 14/week @ 2024-11-02

152 downloads per month
Used in caterpillar

MIT license

31KB
820 lines

dbus-daemon-rs

A tool for starting an new isolated instance of a dbus-daemon or a dbus-broker, with option to configure and start services using D-Bus activation.

Examples

Launching a dbus-daemon process

// Start the dbus-daemon.
let daemon = dbus_launch::Launcher::daemon()
    .launch()
    .expect("failed to launch dbus-daemon");

// Use dbus-daemon by connecting to `daemon.address()` ...

// Stop the dbus-daemon process by dropping it.
drop(daemon);

Starting custom services using D-Bus activation

use std::path::Path;

let daemon = dbus_launch::Launcher::daemon()
    .service("com.example.Test", Path::new("/usr/lib/test-service"))
    .launch()
    .expect("failed to launch dbus-daemon");

// Use com.example.Test service by connecting to `daemon.address()` ...

License

Licensed under MIT License.


lib.rs:

A D-Bus daemon launcher.

A tool for starting an new isolated instance of a dbus-daemon or a dbus-broker, with option to configure and start services using D-Bus activation.

Intended for the use in integration tests of D-Bus services and utilities.

Examples

Launching a dbus-daemon process

// Start the dbus-daemon.
let daemon = dbus_launch::Launcher::daemon()
    .launch()
    .expect("failed to launch dbus-daemon");

// Use dbus-daemon by connecting to `daemon.address()`.

// Stop the dbus-daemon process by dropping it.
drop(daemon);

Starting custom services using D-Bus activation

use std::path::Path;

let daemon = dbus_launch::Launcher::daemon()
    .service("com.example.Test", Path::new("/usr/lib/test-service"))
    .launch()
    .expect("failed to launch dbus-daemon");

// Use com.example.Test service by connecting to `daemon.address()`.

Dependencies

~1.6–10MB
~115K SLoC