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 1130912 - save job displayed as "Stopped" and always taken system resource even if save job finished when running it under background
Summary: save job displayed as "Stopped" and always taken system resource even if save...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-18 07:48 UTC by zhengqin
Modified: 2014-09-10 13:43 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-10 13:43:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhengqin 2014-08-18 07:48:57 UTC
Description of problem:


Version-Release number of selected component (if applicable):
libvirt-1.2.7-1.el7.x86_64
qemu-kvm-rhev-2.1.0-1.el7.x86_64
kernel-3.10.0-142.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1.Prepare a running guest named "rhel6-new", execute the following commands:

[root@rhel7 ~]# virsh save rhel6-new savefile &
[1] 6295
[root@rhel7 ~]# jobs
[1]+  Stopped                 virsh save rhel6-new savefile
[root@rhel7 ~]# jobs
[1]+  Stopped                 virsh save rhel6-new savefile

2. "savefile" is generated and guest is shutoff, but background job displayed as "Stopped"

3. "virsh save" command still taken process resource.
[root@rhel7 ~]# ps aux | grep virsh
root     19227  0.0  0.3 401216  6528 pts/0    Tl   03:39   0:00 virsh save rhel6-new savefile


Actual results:
save job is finished but background job displayed it still "Stopped", and it still taken process resource by checking command "ps" 

Expected results:
save job is finished but background job displayed as "Done", and it should release process resource by checking command "ps"



Additional info:
This issue does not occur on rhel6.6

on rhel6.6:
[root@rhel6 ~]# jobs
[1]+  Running                 virsh save rhel6 rhel6.save &
[root@rhel6 ~]#
Domain rhel6 saved to rhel6.save


[1]+  Done                    virsh save rhel6 rhel6.save

Comment 1 zhe peng 2014-08-19 02:22:28 UTC
This not only occured when using 'save' cmd, 'dump' 'managedsave' also have this issue.

Comment 2 Erik Skultety 2014-09-10 13:43:58 UTC
It is because if a process is executed in background, it cannot read from stdin nor write to stdout (the latter not entirely true, it is controlled by TOSTOP flag in terminal driver which is by default off). If it tries to read from stdin, it receives SIGTTIN signal which resolves into stopping the process by default.
An example:
$ cat &
[1] 24270
$ jobs
[1]+  Stopped    cat

If you place the job back to foreground (fg), everything works as expected. Now the problem why it worked in rhel6 is because there was a different signal handler which introduced a bug https://bugzilla.redhat.com/show_bug.cgi?id=983348 (clone https://bugzilla.redhat.com/show_bug.cgi?id=983350).
Now the handling works as expected and if you really want to run commands that require reading from stdin on background, you might want to redirect the input from /dev/null, in that case the process won't get stopped from trying to read from stdin.

Erik


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