Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
DescriptionStuart Auchterlonie
2016-02-08 12:58:49 UTC
Description of problem:
The manpage of `systemd.service` documents a behaviour of
TimeoutStopSec that is in contradiction to what systemd
actually does.
Man page states:
---
TimeoutStopSec=
Configures the time to wait for stop. If a service is asked to stop, but does not
terminate in the specified time, it will be terminated forcibly via SIGTERM, and
after another timeout of equal duration with SIGKILL
---
However the behaviour is
- SIGTERM is sent immediately on `systemctl stop <service>`
- if the service does no stop after TimeoutStopSec, SIGKILL is sent
Version-Release number of selected component (if applicable):
systemd-219-19.el7.x86_64 (RHEL-7.2)
systemd-222-14.fc23.x86_64 (Fedora 23)
How reproducible:
100%
Steps to Reproduce:
1. Create a simple service that ignores SIGTERM
------ example.c ------
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
int main (int argc, char **argv) {
signal(SIGTERM, SIG_IGN);
sleep(300);
}
------ end example.c -----
2. Create a simple unit file
------ unit file ------
[Unit]
Description=Test service for case 01576130
[Service]
Type=simple
ExecStart=/usr/local/bin/x
TimeoutStopSec=20
------ end unit file ----
3. Start test service
4. Attach gdb to service
5. Stop the service
6. Observe the signals sent to the sample service.
Actual results:
Man page is incorrect (see description)
Expected results:
Man page documents the behaviour of systemd
Additional info:
Uh, sorry it looks that we have overlooked this bug.
It is not that simple, the manual message is in fact correct, there are really three steps, but since your service does not have ExecStop than we don't have anything to wait for, so we go to second step, which is sending sigterm.
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, 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-2018:3245
Description of problem: The manpage of `systemd.service` documents a behaviour of TimeoutStopSec that is in contradiction to what systemd actually does. Man page states: --- TimeoutStopSec= Configures the time to wait for stop. If a service is asked to stop, but does not terminate in the specified time, it will be terminated forcibly via SIGTERM, and after another timeout of equal duration with SIGKILL --- However the behaviour is - SIGTERM is sent immediately on `systemctl stop <service>` - if the service does no stop after TimeoutStopSec, SIGKILL is sent Version-Release number of selected component (if applicable): systemd-219-19.el7.x86_64 (RHEL-7.2) systemd-222-14.fc23.x86_64 (Fedora 23) How reproducible: 100% Steps to Reproduce: 1. Create a simple service that ignores SIGTERM ------ example.c ------ #include <stdio.h> #include <unistd.h> #include <signal.h> int main (int argc, char **argv) { signal(SIGTERM, SIG_IGN); sleep(300); } ------ end example.c ----- 2. Create a simple unit file ------ unit file ------ [Unit] Description=Test service for case 01576130 [Service] Type=simple ExecStart=/usr/local/bin/x TimeoutStopSec=20 ------ end unit file ---- 3. Start test service 4. Attach gdb to service 5. Stop the service 6. Observe the signals sent to the sample service. Actual results: Man page is incorrect (see description) Expected results: Man page documents the behaviour of systemd Additional info: