NAME

Langertha::Holmgang::Sim::Linux::Logrotate - logrotate 3.21 (Debian 12) for the Linux simulator — reads the configuration, checks (-d), rotates (-f)

VERSION

version 0.001

SYNOPSIS

my ( $out, $ok ) = Langertha::Holmgang::Sim::Linux::Logrotate::run( $dev, [ '-d', '/etc/logrotate.d/app' ], $ctx );

DESCRIPTION

Models logrotate of a Debian 12 (3.21.0) on the state of a device (Langertha::Holmgang::Sim::Linux):

  • Configuration: global directives, blocks pattern … { … }, include (directory: files in name order, endings like .dpkg-old are skipped), scripts postrotate/prerotate/firstaction/lastaction up to endscript. Errors like logrotate: unknown directive, missing {, missing }, rotate without a number, duplicate entry for the same file, configuration file writable by group/others.

  • -d: dry run with logrotate's output, changes nothing. -f: rotates now (-v shows the same output while doing so): shift older generations and delete those beyond rotate, copytruncate (copy, original emptied, the service keeps writing to the original file) or rename (the service keeps writing to the renamed file until it reopens it) with create (new empty file with permissions), compress and delaycompress, scripts run in the simulator (systemctl reload|restart … makes a service reopen its log files). Without -f every file has already been rotated today (nothing to do).

  • --version, --help.

Limits: the state file (/var/lib/logrotate/status) is not written; size, maxage, olddir, dateext and mail are read and shown, but not evaluated.

run

my ( $output, $ok ) = run( $device, \@args, $ctx );

logrotate [-d] [-f] [-v] [-s file] configuration….

SUPPORT

Issues

Please report bugs and feature requests at https://github.com/Getty/langertha-holmgang/issues.

IRC

Join #langertha on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.