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 1463542 - script doesn't wait for command completion when running non-interactive
Summary: script doesn't wait for command completion when running non-interactive
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: util-linux
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1463545 1463550
TreeView+ depends on / blocked
 
Reported: 2017-06-21 08:29 UTC by Leos Pol
Modified: 2017-06-23 07:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1463545 (view as bug list)
Environment:
Last Closed: 2017-06-23 07:38:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Leos Pol 2017-06-21 08:29:21 UTC
Description of problem:
Script prematurely exits before command when running in non-interactive shell. See steps and additional sections for more info.

Version-Release number of selected component (if applicable):
util-linux-2.23.2-43.el7

How reproducible:
always

Steps to Reproduce:
1. # script -c 'sleep 1;echo run' < /dev/null && echo finished

Actual results:
Script started, file is typescript
Script done, file is typescript
finished
# run   < this is output from script's command
# 

Expected results:
Script started, file is typescript
run
Script done, file is typescript
finished

Additional info:
Actually "exits" is not the right term here. Script command is running but its parent become PID=1. That's the reason why chained command is executed before script finishes. Also it could block using bash scripts with util-linux's script in for example jenkins, ansible, and so on.

Comment 2 Karel Zak 2017-06-21 09:48:51 UTC
This issue is fixed since v2.27 by script(1) rewrite.

I have doubts we can fix RHEL version without the command rebase. Is it really so critical issue to rebase script(1) for RHEL7.5 ?

The script(1) is originally designed to run interactive session on terminal, use /dev/null as STDIN is not supported for the old versions at all.

Comment 3 Leos Pol 2017-06-23 07:38:44 UTC
I can't evaluate how critical this issue is for customers, but my usecase is be able to run my bash tool with /usr/bin/script in ansible shell task. Due to this issue my tool has different behavior in interactive terminal vs. ansible.

Anyhow I don't think rebase is justified without customer case and I need to run my script on RHEL >= 5, CentOS >= 6, and Fedora, so I've to workaround this anyway.

Closing as WONTFIX.

Thanks.


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