Bug 2371578 - Use `systemctl try-reload-or-restart` in logrotate postrotate script
Summary: Use `systemctl try-reload-or-restart` in logrotate postrotate script
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: coturn
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Robert Scheck
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-06-10 19:30 UTC by Marcos Mello
Modified: 2025-06-28 00:34 UTC (History)
1 user (show)

Fixed In Version: coturn-4.7.0-1.el10_1 coturn-4.7.0-1.el9 coturn-4.7.0-1.fc42 coturn-4.7.0-1.el8 coturn-4.7.0-1.fc41 coturn-4.7.0-1.el10_0
Clone Of:
Environment:
Last Closed: 2025-06-27 00:36:33 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Marcos Mello 2025-06-10 19:30:55 UTC
`systemctl try-reload-or-restart` leverages systemd's knowledge of the daemon's main PID, eliminating the need to rely on PID files or external tools like `killall` or `pkill`. The action of coturn.service's `ExecReload=` sends the same signal as currently sent by `kill`, making it a suitable replacement. This ensures precise signal sending to the intended process, reducing the risk of errors in process identification. Additionally, `systemctl try-reload-or-restart` is silent by default and returns zero if the daemon is inactive. It also logs the action in the service's journal, providing a record of actions taken.

The logrotate configuration snippet:

# cat /etc/logrotate.d/coturn
/var/log/coturn/turnserver.log {
        missingok
        compress
        delaycompress
        notifempty
        postrotate
                /bin/systemctl --quiet is-active coturn.service && /bin/kill -HUP `cat /run/coturn/turnserver.pid` || true
        endscript
        create 0660 coturn coturn
        sharedscripts
        su coturn coturn
}

In the postrotate script, everything can be replaced by:

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

Because:

# systemctl show -P ExecReload coturn.service
{ path=/bin/kill ; argv[]=/bin/kill -HUP $MAINPID ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
# systemctl show -P MainPID coturn.service
1902
# cat /run/coturn/turnserver.pid
1902

Reproducible: Always




Additional Information:
coturn-4.6.3-2.fc42.x86_64

Comment 1 Fedora Update System 2025-06-17 19:25:35 UTC
FEDORA-EPEL-2025-a1313041a3 (coturn-4.7.0-1.el10_1) has been submitted as an update to Fedora EPEL 10.1.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-a1313041a3

Comment 2 Fedora Update System 2025-06-17 19:25:38 UTC
FEDORA-EPEL-2025-9fbf9b847a (coturn-4.7.0-1.el10_0) has been submitted as an update to Fedora EPEL 10.0.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-9fbf9b847a

Comment 3 Fedora Update System 2025-06-17 19:25:42 UTC
FEDORA-EPEL-2025-88df0f0a71 (coturn-4.7.0-1.el9) has been submitted as an update to Fedora EPEL 9.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-88df0f0a71

Comment 4 Fedora Update System 2025-06-17 19:25:45 UTC
FEDORA-2025-2d3ce02f10 (coturn-4.7.0-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-2d3ce02f10

Comment 5 Fedora Update System 2025-06-17 19:25:48 UTC
FEDORA-2025-bab643975d (coturn-4.7.0-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-bab643975d

Comment 6 Fedora Update System 2025-06-17 19:25:51 UTC
FEDORA-EPEL-2025-727fcec719 (coturn-4.7.0-1.el8) has been submitted as an update to Fedora EPEL 8.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-727fcec719

Comment 7 Fedora Update System 2025-06-19 01:43:34 UTC
FEDORA-2025-bab643975d 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-bab643975d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-bab643975d

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

Comment 8 Fedora Update System 2025-06-19 01:52:05 UTC
FEDORA-EPEL-2025-9fbf9b847a has been pushed to the Fedora EPEL 10.0 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-9fbf9b847a

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

Comment 9 Fedora Update System 2025-06-19 02:12:02 UTC
FEDORA-EPEL-2025-88df0f0a71 has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-88df0f0a71

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

Comment 10 Fedora Update System 2025-06-19 02:14:16 UTC
FEDORA-EPEL-2025-a1313041a3 has been pushed to the Fedora EPEL 10.1 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-a1313041a3

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

Comment 11 Fedora Update System 2025-06-19 02:22:58 UTC
FEDORA-EPEL-2025-727fcec719 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-727fcec719

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

Comment 12 Fedora Update System 2025-06-19 02:23:55 UTC
FEDORA-2025-2d3ce02f10 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-2d3ce02f10`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-2d3ce02f10

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

Comment 13 Fedora Update System 2025-06-27 00:36:33 UTC
FEDORA-EPEL-2025-a1313041a3 (coturn-4.7.0-1.el10_1) has been pushed to the Fedora EPEL 10.1 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2025-06-27 01:11:44 UTC
FEDORA-EPEL-2025-88df0f0a71 (coturn-4.7.0-1.el9) has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2025-06-27 01:20:09 UTC
FEDORA-2025-bab643975d (coturn-4.7.0-1.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2025-06-27 01:34:08 UTC
FEDORA-EPEL-2025-727fcec719 (coturn-4.7.0-1.el8) has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2025-06-27 01:58:20 UTC
FEDORA-2025-2d3ce02f10 (coturn-4.7.0-1.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2025-06-28 00:34:16 UTC
FEDORA-EPEL-2025-9fbf9b847a (coturn-4.7.0-1.el10_0) has been pushed to the Fedora EPEL 10.0 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.