DOKK / manpages / debian 12 / liblinux-systemd-perl / Linux::Systemd::Daemon.3pm.en
Linux::Systemd::Daemon(3pm) User Contributed Perl Documentation Linux::Systemd::Daemon(3pm)

Linux::Systemd::Daemon - Systemd daemon API

version 1.201600

  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...');

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".

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');

Convenience function. Optional export.

Convenience function. Optional export.

Convenience function. Optional export.

Convenience function. Optional export.

Convenience function. Optional export.

https://www.freedesktop.org/software/systemd/man/sd-daemon.html

Ioan Rogers <ioanr@cpan.org>

This software is Copyright (c) 2020 by Ioan Rogers.

This is free software, licensed under:

  The GNU Lesser General Public License, Version 2.1, February 1999
2022-10-20 perl v5.36.0