Project

General

Profile

Bug #24927

Ansible processes might get killed when logrotate runs for smart_proxy_dynflow_core

Added by Adam Ruzicka 3 months ago. Updated 2 months ago.


Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1628505

Description of problem:
We used systemctl kill ... to deliver SIGUSR1 to smart_proxy_dynflow_core to make it reopen its logs. While systemctl kill delivered the signal reliably, it delivered the signal to every process in the service's control group. The issue was when the service forked more processes (when running ansible-playbook). pkill signals only the processes with matching name.

Ansible-playbook reacts to SIGUSR{1,2} by printing "User defined signal
1" and exiting, which is undesired.

Version-Release number of selected component (if applicable):
6.4

How reproducible:
Always

Steps to Reproduce:
1. Run sleep 1000 using the ansible command template
2. When the job runs, run logrotate -f /etc/logrotate.conf -v
3. (optional) Watch the logrotate output as it may not rotate the logs if they were rotated recently

Actual results:
Logs are rotated, ansible processes die. Possible IOError shown in the jobs output

Expected results:
Logs are rotated, running ansible processes are left intact.

Additional info:

Associated revisions

Revision 32f54190 (diff)
Added by Adam Ruzicka 3 months ago

Fixes #24927 - Fix sending signal after logrotate

The solution with using pkill was not ideal as pkill
would match the process it was meant to kill and the
shell running pkill as well. This could lead to
a situation where the shell would be killed first
and the signal would not be delivered to the intended
target process.

Revision d0b234b3 (diff)
Added by Adam Ruzicka 3 months ago

Fixes #24927 - Fix sending signal after logrotate

The solution with using pkill was not ideal as pkill
would match the process it was meant to kill and the
shell running pkill as well. This could lead to
a situation where the shell would be killed first
and the signal would not be delivered to the intended
target process.

History

#1 Updated by Adam Ruzicka 3 months ago

  • Assignee set to Adam Ruzicka
  • Status changed from New to Ready For Testing
  • Subject changed from Ansible processes might get killed when logrotate runs for smart_proxy_dynflow_core to Ansible processes might get killed when logrotate runs for smart_proxy_dynflow_core
  • Pull request https://github.com/theforeman/foreman-packaging/pull/2940, https://github.com/theforeman/foreman-packaging/pull/2939 added

#2 Updated by Ivan Necas 3 months ago

  • Status changed from Ready For Testing to Closed

#3 Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/theforeman/foreman-packaging/pull/3054 added

#4 Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/theforeman/foreman-packaging/pull/3055 added

#5 Updated by Tomer Brisker 2 months ago

  • Fixed in Releases 1.20.0 added

Also available in: Atom PDF