Linux::Systemd::Daemon3pm
Systemd daemon api
Usage
use Linux::Systemd::Daemon 'sd_ready';# program initialisationsd_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.
Copyright and license
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
Releases
2 releases since Debian 12 (Bookworm); the text changed 1 time.