Linux::Systemd::Daemon(3pm)

Linux::Systemd::Daemon3pm

Systemd daemon api

Usage

  use Linux::Systemd::Daemon 'sd_ready';
  # program initialisation
  sd_ready;
  while (1) {
      sd_notify(watchdog => 1, status => 'Main loop running');
      # do something here
  }
  sd_notify(stopping => 1, status => 'Shutting down...');

Version

version 1.201600

Overview

An XS wrapper for sd-daemon <https://www.freedesktop.org/software/systemd/man/sd-daemon.html>, the systemd daemon interface.

Exports one function, "sd_notify", by default. A variety of convenience functions are also available for import, either individually or with the ":all" tag.

For a fully featured example, see the "perl-daemon" script and "perl-daemon.service" examples in "eg".

Functions

sd_notify(@array_of_pairs)

The main function, exported by default. Takes a list of pairs and converts them to a string to be passed to the C function man:sd_notify(3) <https://www.freedesktop.org/software/systemd/man/sd_notify.html>

e.g.

  sd_notify(ready => 1, status => 'Processing requests');

sd_watchdog()

Convenience function. Optional export.

sd_ready()

Convenience function. Optional export.

sd_stopping()

Convenience function. Optional export.

sd_reloading()

Convenience function. Optional export.

"sd_status(Str $status_message)"

Convenience function. Optional export.

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

Author

Ioan Rogers <[email protected]>

From liblinux-systemd-perl 1.201600-4+b4 in Debian 13 (Trixie). Parsed by carta from the page's man source.