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 1308450 - Allow parent processes to terminate graciously after calling shutdown -r now/reboot/init 6
Summary: Allow parent processes to terminate graciously after calling shutdown -r now/...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 1274433 (view as bug list)
Depends On:
Blocks: 1289485
TreeView+ depends on / blocked
 
Reported: 2016-02-15 09:26 UTC by Tomáš Kašpárek
Modified: 2016-02-15 13:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-15 12:47:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tomáš Kašpárek 2016-02-15 09:26:07 UTC
Description of problem:
When calling shutdown -r/reboot/init 6 parent process should be allowed to terminate graciously like on RHEL6 where systemd is not used.

Version-Release number of selected component (if applicable):
systemd-219-19.el7.x86_64

How reproducible:
always, deterministic

Steps to Reproduce:
1. execute bash script with following content (as root):
#!/bin/bash

shutdown -r now
touch /root/test

2. ls /root/test
3. file /root/test does not exist

4. shutdown -r now can be replaced with either reboot or init 6, behavior is not changed

Actual results:
File /root/test does not exist as parent process is not allowed to terminate graciously.

Expected results:
File /root/test should exist like it does when executed on RHEL 6.7 machine (it gets created on RHEL 6.7 in all 3 cases).

Additional info:
This behavior is root cause of following bug: https://bugzilla.redhat.com/show_bug.cgi?id=1260527

Comment 1 Lukáš Nykrýn 2016-02-15 12:47:18 UTC
Well, your reproducer should not work anywhere because:

1) Init will send you sigterm immediately which will kill your script.
2) Termination of login process will end up with sighup, which will kill your script.

If you try to block those signals:
[root@localhost ~]# cat test.sh 
#!/bin/bash
logger "XXXXX-my pid: $$"
trap "echo nope" SIGTERM SIGINT
reboot &
sleep 2
echo whoohooo > /root/out
[root@localhost ~]# nohup ./test.sh

The /root/out will be created. I guess it worked for you on rhel6 only because the shutdown was pretty slow there.

Comment 2 Lukáš Nykrýn 2016-02-15 13:08:56 UTC
*** Bug 1274433 has been marked as a duplicate of this bug. ***


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