Red Hat Bugzilla – Bug 1438709
Fix supermin init so it doesn't issue ioctl TIOCSCTTY
Last modified: 2018-04-10 09:47:08 EDT
Description of problem: The following (small) patch is required for the new virt-rescue to work: https://www.redhat.com/archives/libguestfs/2017-April/msg00001.html Version-Release number of selected component (if applicable): supermin5-5.1.16-4.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Run virt-rescue >= 1.37. Actual results: The bash shell in virt-rescue prints: bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell Also ^C does not work properly. Expected results: The message above should not be printed, and ^C should work properly (ie. kill processes inside the virt-rescue shell, and not be ignored or kill the whole of virt-rescue).
I pushed the following two commits. Only the first one is necessary fof fixing virt-rescue. https://github.com/libguestfs/supermin/commit/ec0ec99d0d6efd958f51d961b4820dad75aab4ed https://github.com/libguestfs/supermin/commit/63b21b5c66534cc85da26cb9896e57bd161f3a42
Verified with the following packages: libguestfs-1.36.10-2.el7.x86_64 supermin5-5.1.19-1.el7.x86_64 Steps: 1. #virt-rescue --scratch ------------------------------------------------------------- ... Welcome to virt-rescue, the libguestfs rescue shell. Note: The contents of / (root) are the rescue appliance. You have to mount the guest's partitions under /sysroot before you can examine them. ><rescue> top top - 03:03:32 up 0 min, 0 users, load average: 0.00, 0.00, 0.00 Tasks: 50 total, 1 running, 49 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.0 us, 0.7 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 487924 total, 444540 free, 9068 used, 34316 buff/cache KiB Swap: 0 total, 0 free, 0 used. 460344 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 185 root 20 0 51900 1876 1400 R 1.3 0.4 0:00.04 top 1 root 20 0 11644 1516 1276 S 0.0 0.3 0:00.20 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0 4 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H 6 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u2:0 7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 9 root 20 0 0 0 0 S 0.0 0.0 0:00.06 rcu_sched 10 root rt 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0 12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs 13 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns 14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd 15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback 16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd 17 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset ><rescue> ><rescue> exit ------------------------------------------------------------- 2. There is no error about "bash: cannot set terminal process group...". 3. Input the top command, then ^C. The top command exits normally. Also the whole of virt-rescue is not killed by ^C. So verified this bug.
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/RHEA-2018:0792