Expand description
Rust interfaces to libsystemd and compatible libraries.
Native APIs introduced in newer releases require explicit Cargo features:
systemd_v240 enables boot-specific application IDs and bus timeout APIs;
systemd_v241 adds the raw close-and-unref helper; systemd_v245 adds
journal namespaces; systemd_v254 adds session start-time queries. Each
version feature includes the earlier version features. The default bus
feature requires the callback-lifetime APIs from systemd 239. With bus
disabled, the base APIs require systemd 233 or equivalent capabilities.
The build script checks required native symbols by linking a probe for the
target without running it. This includes explicit SYSTEMD_LIB_DIR and
SYSTEMD_LIBS selections and libraries selected by SYSTEMD_PKG_NAME,
including libelogind. Disable unsupported features or install a library
providing the selected APIs when the capability check fails.
Fallible systemd APIs use Error and Result. The crate-owned error preserves errno
and I/O error kinds while adding operation and argument context. See Error for migration
from the previous std::io::Error re-export. D-Bus method errors use bus::Error
when the bus feature is enabled; logger installation uses log::SetLoggerError.
Re-exports§
pub use journal::JournalFiles;Deprecated journalpub use journal::FormattedJournalLog;journalpub use journal::Journal;journalpub use journal::JournalLog;journalpub use journal::JournalRecord;journalpub use journal::JournalSeek;journalpub use journal::JournalWaitResult;journal
Modules§
- bus
bus - An interface to work with the dbus message bus.
- daemon
- id128
- APIs to process and generate 128-bit ID values for systemd.
- journal
journal - High-level interface to the systemd journal.
- login
- Interface to introspect on seats, sessions and users. Queries for processes, users, and login sessions.
- unit
- Utilities for working with systemd units.
Macros§
- log_
with - Similar to
log!(), except it accepts a func argument rather than hard coding::log::log(), and it doesn’t filter onlog_enabled!(). - sd_
journal_ log journal - Log a message with source location metadata, returning
Result<()>.
Structs§
- Error
- An error from a systemd operation, with its underlying cause and optional context.
Traits§
- CStr
Argument - A string argument for an API that needs a NUL-terminated string.
Functions§
- ffi_
result - Convert a systemd ffi return value into a Result