RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1837401 - keepalived sends SIGTERM to systemd on restart
Summary: keepalived sends SIGTERM to systemd on restart
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: keepalived
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Ryan O'Hara
QA Contact: Brandon Perkins
URL:
Whiteboard:
Depends On: 1889440
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-19 12:40 UTC by Gregory Thiemonge
Modified: 2021-05-18 16:10 UTC (History)
2 users (show)

Fixed In Version: keepalived-2.1.5-5.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 16:10:55 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gregory Thiemonge 2020-05-19 12:40:57 UTC
Description of problem:
When using misc_check with misc_timeout, after a failed check, restarting keepalived sends a SIGTERM to systemd (pid 1)

Version-Release number of selected component (if applicable):
keepalived-2.0.10-10.el8.x86_64
8.2

How reproducible:
100%

Steps to Reproduce:
1. Launch keepalived with a config that uses misc_check and misc_timeout:

virtual_server 172.16.0.32 1234 {
    lb_algo rr
    lb_kind NAT
    protocol UDP
    delay_loop 5
    delay_before_retry 5
    retry 3

    real_server 172.16.0.32 1235 {
        weight 1
        uthreshold 100000
        MISC_CHECK {
            misc_path "sleep 3"
            misc_timeout 2
        }
    }
}

Logs:

Tue May 19 08:15:03 2020: Starting Keepalived v2.0.10 (11/12,2018)
Tue May 19 08:15:03 2020: Running on Linux 4.18.0-193.el8.x86_64 #1 SMP Fri Mar 27 14:35:58 UTC 2020 (built for Linux 4.18.0)
Tue May 19 08:15:03 2020: Command line: 'keepalived' '-D' '-l' '-G' '-n' '--pid=keepalived.pid' '-f' 'keepalived.conf'
Tue May 19 08:15:03 2020: Opening file 'keepalived.conf'.
Tue May 19 08:15:03 2020: Starting Healthcheck child process, pid=857707
Tue May 19 08:15:03 2020: Opening file 'keepalived.conf'.
Tue May 19 08:15:03 2020: WARNING - default user 'keepalived_script' for script execution does not exist - please create.
Tue May 19 08:15:03 2020: WARNING - script `sleep` resolved by path search to `/bin/sleep`. Please specify full path.
Tue May 19 08:15:03 2020: SECURITY VIOLATION - check scripts are being executed but script_security not enabled.
Tue May 19 08:15:03 2020: Initializing ipvs
Tue May 19 08:15:03 2020: Gained quorum 1+0=1 <= 1 for VS [172.16.0.32]:udp:1234
Tue May 19 08:15:03 2020: Activating healthchecker for service [172.16.0.32]:udp:1235 for VS [172.16.0.32]:udp:1234


2. Wait for misc_check to fail

Tue May 19 08:15:10 2020: Misc check for [[172.16.0.32]:udp:1235 VS [172.16.0.32]:udp:1234] by [/usr/bin/sleep] timed out.
Tue May 19 08:15:10 2020: Removing service [172.16.0.32]:udp:1235 to VS [172.16.0.32]:udp:1234
Tue May 19 08:15:10 2020: Lost quorum 1-0=1 > 0 for VS [172.16.0.32]:udp:1234


3. Send a TERM signal to keepalived (or systemctl restart)

$ sudo kill -TERM $(cat keepalived.pid)


Actual results:
systemd receives a TERM signal from keepalived and restarts

May 19 08:15:13 undercloud-0.redhat.local systemd[1]: Received SIGTERM from PID 857707 (keepalived).
May 19 08:15:13 undercloud-0.redhat.local systemd[1]: Reexecuting.
May 19 08:15:13 undercloud-0.redhat.local kernel: printk: systemd: 49 output lines suppressed due to ratelimiting
May 19 08:15:13 undercloud-0.redhat.local systemd[1]: systemd 239 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ >
May 19 08:15:13 undercloud-0.redhat.local systemd[1]: Detected virtualization kvm.
May 19 08:15:13 undercloud-0.redhat.local systemd[1]: Detected architecture x86-64.

Note that "systemctl restart" returns an error


Expected results:
keepalived should exit gracefully, systemd shouldn't be affected


Additional info:

https://github.com/acassen/keepalived/pull/1478/commits/2738ee60b394ab859de18d1a4c8e332cc55887ea fixes that issue.

Comment 13 errata-xmlrpc 2021-05-18 16:10:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (keepalived bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1927


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