Bug 2372859 - Use `systemctl try-restart` in logrotate postrotate script
Summary: Use `systemctl try-restart` in logrotate postrotate script
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: minidlna
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Dominik 'Rathann' Mierzejewski
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-06-14 18:43 UTC by Marcos Mello
Modified: 2025-07-18 01:09 UTC (History)
6 users (show)

Fixed In Version: minidlna-1.3.3-13.fc43 minidlna-1.3.3-13.fc42 minidlna-1.3.3-10.fc41
Clone Of:
Environment:
Last Closed: 2025-07-07 16:53:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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