systemctl 0.1.0

Small crate to interact with systemd units
Documentation

systemctl

Small rust crate to interact with systemd units

crates.io License License crates.io
Rust crates.io

Unit / service operation

Nominal service operations:

use systemctl;
systemctl::stop("systemd-journald.service").unwrap();
systemctl::restart("systemd-journald.service").unwrap();

Service enumeration

use systemctl;
// list all units
systemctl::list_units(None, None);

// list all services 
// by adding a --type filter
systemctl::list_units(Some("service"), None);

// list all services currently `enabled` 
// by adding a --state filter
systemctl::list_units(Some("service"), Some("enabled"));