systemctl
Small rust crate to interact with systemd units
Unit / service operation
Nominal service operations:
.unwrap;
restart
.unwrap;
if let Ok = exists
stop
Service enumeration
use systemctl;
// list all units
list_units;
// list all services
// by adding a --type filter
list_units;
// list all services currently `enabled`
// by adding a --state filter
list_units;
Unit structure
Use the unit structure for more information
let unit = from_systemctl
.unwrap;
unit.restart.unwrap;
println!;
println!;
if let Some = unit.docs
println!;
println!;
println!;
println!;
println!;
TODO
- parse all known attributes in
from_systemctl
- currently we study (try to parse) stdio result from systemctl() invokation,
without testing the exit status, which is bad. This is due to the fact
that we get apparently get an error code, on existing units that currently have a
dead
state