Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucab/libsystemd-rs
A pure-Rust client library to work with systemd
https://github.com/lucab/libsystemd-rs
Last synced: 4 days ago
JSON representation
A pure-Rust client library to work with systemd
- Host: GitHub
- URL: https://github.com/lucab/libsystemd-rs
- Owner: lucab
- License: other
- Created: 2017-09-03T19:44:41.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-26T04:35:09.000Z (9 months ago)
- Last Synced: 2024-04-24T09:25:15.667Z (7 months ago)
- Language: Rust
- Homepage: https://crates.io/crates/libsystemd
- Size: 275 KB
- Stars: 102
- Watchers: 6
- Forks: 19
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE-2.0
Awesome Lists containing this project
README
# libsystemd
[![crates.io](https://img.shields.io/crates/v/libsystemd.svg)](https://crates.io/crates/libsystemd)
[![LoC](https://tokei.rs/b1/github/lucab/libsystemd-rs?category=code)](https://github.com/lucab/libsystemd-rs)
[![Documentation](https://docs.rs/libsystemd/badge.svg)](https://docs.rs/libsystemd)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](https://github.com/jmesmon/rust-systemd) instead.
## Example
```rust
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](examples).
## License
Licensed under either of
* MIT license -
* Apache License, Version 2.0 -at your option.