Bug 2372368 - Modernize logrotate postrotate script with `systemctl try-reload-or-restart`
Summary: Modernize logrotate postrotate script with `systemctl try-reload-or-restart`
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: yadifa
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Denis Fateyev
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-06-11 22:39 UTC by Marcos Mello
Modified: 2025-08-07 00:53 UTC (History)
1 user (show)

Fixed In Version: yadifa-2.6.7-4.fc42
Clone Of:
Environment:
Last Closed: 2025-08-07 00:53:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Marcos Mello 2025-06-11 22:39:45 UTC
The logrotate configuration snippet:

# cat /etc/logrotate.d/yadifa
/var/log/yadifa/*log {
    daily
    rotate 10
    compress
    missingok
    notifempty
    sharedscripts
    postrotate
        if [ -f "/usr/sbin/service" ]; then
            /usr/sbin/service yadifad reload > /dev/null 2>/dev/null || true
        else
            /sbin/service yadifad reload > /dev/null 2>/dev/null || true
        fi
    endscript
}

The postrotate script can be updated by replacing the obsolete `service` commands with a modern alternative, as the daemon uses a native systemd unit file:

/usr/bin/systemctl try-reload-or-restart yadifad.service

`try-reload-or-restart` is silent by default and returns zero if the daemon is inactive.

Reproducible: Always




Additional Information:
yadifa-2.6.7-2.fc42.x86_64

Comment 1 Fedora Update System 2025-07-29 22:23:42 UTC
FEDORA-2025-895bc2c19a (yadifa-2.6.7-4.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-895bc2c19a

Comment 2 Fedora Update System 2025-07-30 02:06:30 UTC
FEDORA-2025-895bc2c19a has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-895bc2c19a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-895bc2c19a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 3 Fedora Update System 2025-08-07 00:53:01 UTC
FEDORA-2025-895bc2c19a (yadifa-2.6.7-4.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.