Expand description
A logcontrol::LogControl1 frontend with zbus.
LogControl1 provides the D-Bus interface implementation. It receives the
underlying logcontrol::LogControl1 as sole argument and exposes it
over D-Bus, as a standard zbus D-Bus interface:
ⓘ
use logcontrol_zbus::{LogControl1, ConnectionBuilderExt};
#[async_std::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let control = create_log_control();
let _conn = zbus::ConnectionBuilder::session()?
.name("de.swsnr.logcontrol.SimpleServerExample")?
.serve_log_control(LogControl1::new(control))?
.build()
.await?;
// Do other things or go to wait forever
std::future::pending::<()>().await;
Ok(())
}Note that for systemctl to find the log control interface with
systemctl service-log-level and systemctl service-log-target you need
to make sure that
- the interface is registered under
logcontrol::DBUS_OBJ_PATH, and - the unit file provides the claimed bus name in the
BusNameattribute.
Otherwise systemd will not be able to change the log level or target.
Re-exports§
pub use logcontrol;
Structs§
- LogControl1
- A
zbusfrontend forlogcontrol::LogControl1.
Statics§
- DBUS_
OBJ_ PATH - The D-Bus object path a log control interface needs to be served on for systemd to find it.
Traits§
- Connection
Builder Ext - Extend
ConnectionBuilderto serve log control interfaces.