Module: Systemd::Id128
- Defined in:
- lib/systemd/id128.rb
Overview
Provides access to the 128-bit IDs for various items in the systemd ecosystem, such as the machine id and boot id.
Defined Under Namespace
Modules: Native
Class Method Summary collapse
-
.boot_id ⇒ String
Get the 128-bit hex string identifying the current system’s current boot.
-
.machine_id ⇒ String
Get the 128-bit hex string identifying the current machine.
-
.random ⇒ String
Get a random 128-bit hex string.
Class Method Details
.boot_id ⇒ String
Get the 128-bit hex string identifying the current system’s current boot. Can be used to filter a journal to show only messages originating from the current boot.
25 26 27 |
# File 'lib/systemd/id128.rb', line 25 def self.boot_id @boot_id ||= read_id128(:sd_id128_get_boot) end |
.machine_id ⇒ String
Get the 128-bit hex string identifying the current machine. Can be used to filter a journal to show only messages originating from this machine.
14 15 16 |
# File 'lib/systemd/id128.rb', line 14 def self.machine_id @machine_id ||= read_id128(:sd_id128_get_machine) end |
.random ⇒ String
Get a random 128-bit hex string.
31 32 33 |
# File 'lib/systemd/id128.rb', line 31 def self.random read_id128(:sd_id128_randomize) end |