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 1305509 - [man] systemd.service documentation on TimeoutStopSec is incorrect
Summary: [man] systemd.service documentation on TimeoutStopSec is incorrect
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jan Synacek
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks: 1298243 1420851 1466365 1473733 1546815 1549617 1551061
TreeView+ depends on / blocked
 
Reported: 2016-02-08 12:58 UTC by Stuart Auchterlonie
Modified: 2022-03-13 14:00 UTC (History)
4 users (show)

Fixed In Version: systemd-219-59.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 11:32:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Stuart 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:

Comment 3 Lukáš Nykrýn 2016-07-25 11:45:54 UTC
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.

Comment 11 Jan Synacek 2018-06-18 12:49:35 UTC
https://github.com/systemd/systemd/issues/9325

Comment 12 Jan Synacek 2018-06-22 07:14:52 UTC
https://github.com/systemd/systemd/pull/9378

Comment 13 Jan Synacek 2018-06-22 11:12:55 UTC
https://github.com/lnykryn/systemd-rhel/pull/218

Comment 14 Lukáš Nykrýn 2018-06-28 07:20:18 UTC
fix merged to staging branch -> https://github.com/lnykryn/systemd-rhel/pull/218 -> post

Comment 18 errata-xmlrpc 2018-10-30 11:32:10 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, 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


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