Skip to content

A pure-Rust client library to work with systemd

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE-2.0
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

lucab/libsystemd-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libsystemd

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.

About

A pure-Rust client library to work with systemd

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE-2.0
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages