#systemd #linux

libsystemd

A pure-Rust client library to interact with systemd

3 unstable releases

0.1.0 May 13, 2019
0.0.2 Sep 17, 2017
0.0.1 Sep 3, 2017

#82 in Unix APIs

Download history 16/week @ 2019-03-26 3/week @ 2019-04-02 4/week @ 2019-04-09 3/week @ 2019-04-23 4/week @ 2019-04-30 16/week @ 2019-05-07 98/week @ 2019-05-14 63/week @ 2019-05-21 88/week @ 2019-05-28 53/week @ 2019-06-04 75/week @ 2019-06-11 73/week @ 2019-06-18 85/week @ 2019-06-25 131/week @ 2019-07-02

111 downloads per month
Used in 1 crate

MIT/Apache

17KB
330 lines

libsystemd

Build Status crates.io LoC Documentation

A pure-Rust client library to work with systemd.

It provides support to interact with systemd components available on modern Linux systems. This crate is entirely implemented in Rust, and does not require the libsystemd C library.

NB: this crate is not yet features-complete. If you don't care about C dependency, check rust-systemd instead.

Example

extern crate libsystemd;
use libsystemd::daemon::{self, NotifyState};

fn main() {
    if !daemon::booted() {
        panic!("Not running systemd, early exit.");
    };

    let sent = daemon::notify(true, &[NotifyState::Ready]).expect("notify failed");
    if !sent {
        panic!("Notification not sent, early exit.");
    };
    std::thread::park();
}

Some more examples are available under examples.

License

Licensed under either of

at your option.

Dependencies

~3MB
~63K SLoC