Linux-Systemd

 view release on metacpan or  search on metacpan

lib/Linux/Systemd/Daemon.pm  view on Meta::CPAN


  while (1) {
      sd_notify(watchdog => 1, status => 'Main loop running');
      # do something here
  }

  sd_notify(stopping => 1, status => 'Shutting down...');

=head1 DESCRIPTION

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

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

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

=head1 FUNCTIONS

=head2 C<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
L<man:sd_notify(3)|https://www.freedesktop.org/software/systemd/man/sd_notify.html>

e.g.

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

=head2 C<sd_watchdog()>

Convenience function. Optional export.

=head2 C<sd_ready()>

lib/Linux/Systemd/Daemon.pm  view on Meta::CPAN

=head2 C<sd_reloading()>

Convenience function. Optional export.

=head2 C<sd_status(Str $status_message)>

Convenience function. Optional export.

=head1 SEE ALSO

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

=head1 AUTHOR

Ioan Rogers <ioanr@cpan.org>

=head1 COPYRIGHT AND LICENSE

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

This is free software, licensed under:

lib/Linux/Systemd/Journal/Write.pm  view on Meta::CPAN

package Linux::Systemd::Journal::Write 1.201600;

# ABSTRACT: XS wrapper around sd-journal

# TODO Helper script to generate message catalogs?
# http://www.freedesktop.org/wiki/Software/systemd/catalog/

# TODO make sure all text is utf8

use v5.10.1;
use Moo;
use Carp;
use XSLoader;
XSLoader::load;


lib/Linux/Systemd/Journal/Write.pm  view on Meta::CPAN


=item *

L<Log::Journald>

At some point between me writing this module and getting around to releasing it,
another module was released to write the journal.

=item *

L<systemd|http://www.freedesktop.org/wiki/Software/systemd/>

The main C<systemd> page.

=item *

L<sd-journal(3)>

Man page of the C API

=back



( run in 0.241 second using v1.01-cache-2.11-cpan-299005ec8e3 )