* fix calculations for time differences * fix extension for zip compression * fix omitted copy for logs with `mail` and `rotate 0` * fix wrongly skipping copy with `copytruncate` and `compress` * fix ambiguities between `mode`, `UID` and `GID` parsing when not specifying all options * fix hang when encountering a named pipe * on prerotate failure logs are preserved instead of rotated * in case a configuration file was skipped due to unsafe permissions the * exit status after rotattion will be `1` * the state is no longer written to non-regular files * the systemd timer now correctly utilizes load distribution * add dateformat specifier `%z` for timezone offsets * change default mode for created `olddir` directories to `0755` * support quoted user and group names in `su`, `create`, and `createolddir` - update logroate.keyring: new maintainer - drop logrotate-3.19.0-systemd_add_home_env.patch: - Adapted man page: logrotate-3.19.0-man_logrotate.patch - Add "Environment=HOME=/root" to logrotate.service file in order - remove unused PreReq tags - Enable Persistent timer since we are now in systemd 219. * logrotate-3.7.8-conf.patch > logrotate-conf.patch * logrotate-manpage_config_clarification.patch - Also, avoid logrotate unit activation when the system is - Migrate from cron to systemd timer units, this is overall the most important package to migrate since it is one OBS-URL: https://build.opensuse.org/package/show/Base:System/logrotate?expand=0&rev=108
29 lines
736 B
Bash
29 lines
736 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
configs=
|
|
|
|
# Only read /usr/etc/logrotate.conf if /etc/logrotate.conf does not exist
|
|
if ! [ -e /etc/logrotate.conf ]; then
|
|
configs="$configs /usr/etc/logrotate.conf"
|
|
else
|
|
configs="$configs /etc/logrotate.conf"
|
|
fi
|
|
|
|
# Then read in all of {/usr,}/etc/logrotate.d/*, with /etc/ overriding /usr/etc/.
|
|
dirs=
|
|
[ -d /usr/etc/logrotate.d ] && dirs="/usr/etc/logrotate.d"
|
|
[ -d /etc/logrotate.d ] && dirs="$dirs /etc/logrotate.d"
|
|
|
|
if [ -n "$dirs" ]; then
|
|
for confname in $(find $dirs -type f -printf "%P\n" | sort -u); do
|
|
if [ -e "/etc/logrotate.d/$confname" ]; then
|
|
configs="$configs /etc/logrotate.d/$confname"
|
|
else
|
|
configs="$configs /usr/etc/logrotate.d/$confname"
|
|
fi
|
|
done
|
|
fi
|
|
|
|
exec /usr/sbin/logrotate $configs
|