Bug 2372859

Summary: Use `systemctl try-restart` in logrotate postrotate script
Product: [Fedora] Fedora Reporter: Marcos Mello <marcosfrm>
Component: minidlnaAssignee: Dominik 'Rathann' Mierzejewski <dominik>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: dominik, epel-packagers-sig, jonathan, multimedia-sig, musuruan, pemensik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: minidlna-1.3.3-13.fc43 minidlna-1.3.3-13.fc42 minidlna-1.3.3-10.fc41 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-07-07 16:53:47 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-14 18:43:28 UTC
The logrotate configuration snippet:

# cat /etc/logrotate.d/minidlna
/var/log/minidlna/*.log
{
    rotate 4
    weekly
    missingok
    notifempty
    delaycompress
    compress
    create 0644 minidlna minidlna
    postrotate
        /usr/bin/systemctl restart minidlna.service >/dev/null 2>&1 || true
    endscript
}

If the daemon is inactive, `systemctl restart` will start it unconditionally. The correct verb in this scenario is `try-restart`, which will only restart if the daemon is active, doing nothing otherwise.

Reproducible: Always




Additional Information:
minidlna-1.3.3-10.fc42.x86_64

Comment 1 Fedora Update System 2025-07-07 16:50:33 UTC
FEDORA-2025-7dbb8de594 (minidlna-1.3.3-13.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-7dbb8de594

Comment 2 Fedora Update System 2025-07-07 16:53:47 UTC
FEDORA-2025-7dbb8de594 (minidlna-1.3.3-13.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 3 Fedora Update System 2025-07-07 16:56:34 UTC
FEDORA-2025-0f490a9a10 (minidlna-1.3.3-10.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-0f490a9a10

Comment 4 Fedora Update System 2025-07-07 16:56:34 UTC
FEDORA-2025-9fb8ee63fb (minidlna-1.3.3-13.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-9fb8ee63fb

Comment 5 Fedora Update System 2025-07-10 16:00:02 UTC
FEDORA-2025-9fb8ee63fb 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-9fb8ee63fb`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-9fb8ee63fb

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

Comment 6 Fedora Update System 2025-07-10 18:44:58 UTC
FEDORA-2025-0f490a9a10 has been pushed to the Fedora 41 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-0f490a9a10`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-0f490a9a10

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

Comment 7 Fedora Update System 2025-07-18 01:05:54 UTC
FEDORA-2025-9fb8ee63fb (minidlna-1.3.3-13.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2025-07-18 01:09:25 UTC
FEDORA-2025-0f490a9a10 (minidlna-1.3.3-10.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.