Bug 2372368

Summary: Modernize logrotate postrotate script with `systemctl try-reload-or-restart`
Product: [Fedora] Fedora Reporter: Marcos Mello <marcosfrm>
Component: yadifaAssignee: Denis Fateyev <denis>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 42CC: denis
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: yadifa-2.6.7-4.fc42 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-08-07 00:53:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.