This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1463542 - script doesn't wait for command completion when running non-interactive
script doesn't wait for command completion when running non-interactive
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: util-linux (Show other bugs)
7.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Karel Zak
qe-baseos-daemons
:
Depends On:
Blocks: 1463545 1463550
  Show dependency treegraph
 
Reported: 2017-06-21 04:29 EDT by Leos Pol
Modified: 2017-06-23 03:38 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1463545 (view as bug list)
Environment:
Last Closed: 2017-06-23 03:38:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Leos Pol 2017-06-21 04:29:21 EDT
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 05:48:51 EDT
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 03:38:44 EDT
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.