Bug 519237
Summary: | -bash: cannot set terminal process group (-1): Inappropriate ioctl for device | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | James Laska <jlaska> | ||||||
Component: | util-linux-ng | Assignee: | Karel Zak <kzak> | ||||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | rawhide | CC: | awilliam, bernie+fedora, cdahlin, dcantrell, dougsland, dwalsh, gansalmon, gozen, harald, itamar, jforbes, jturner, kernel-maint, kzak, markmc, notting, pavan.naregundi, plautrba, rrakus, virt-maint, zing | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2009-10-05 19:49:39 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 498968, 507678 | ||||||||
Attachments: |
|
Description
James Laska
2009-08-25 19:38:13 UTC
Still a problem on rawhide-20090903 installs. The common factor I believe is systems without a local console ... that are accessed only by a serial console (e.g. virt and server-class systems). This bug was reviewed at the Fedora 12 Beta Blocker bug meeting on 2009-09-11. Not sure if we have the correct component identified, but taking a stab by changing to 'upstart'. Need feedback from upstart maintainer. This bug was reviewed at the Fedora 12 Beta Blocker bug meeting on 2009-09-18. Nobody is still clear what component this bug belongs to. Trying "kernel" next. Per cdahlin "if the serial console is the primary console upstart might mess with it a bit, but other than that the only place upstart touches serial console is indirectly via agetty." Possibly related to https://bugzilla.redhat.com/show_bug.cgi?id=514022 (In reply to comment #3) > Possibly related to bug #514022 That's a dracut issue which harald has closed wontfix - can anyone confirm this only happens with a dracut initramfs? Also, it seems now that Ctrl-C in a serial console causes the machine to shutdown; I think that's probably relatwd I can confirm that this only happens with a dracut initramfs. It does not happen with mkinitrd created images. dracut guys, please note that this bug is blocking the Beta release, and if possibly expedite accordingly - thanks! -- Fedora Bugzappers volunteer triage team https://fedoraproject.org/wiki/BugZappers This is what helped me: /* get session leader */ setsid(); /* set controlling terminal */ if (ioctl (0, TIOCSCTTY, 1)) warn("failed to TIOCSCTTY"); and maybe reset the terminal... nevertheless dracut can't do that, because it is a shell script. Though switch_root should have already done this for /sbin/init. are you sure this is only with dracut? what does: # rpm -q util-linux-ng # rpm -q dracut # dmesg | grep dracut output? I just tried with mkinitrd... it doesn't happen. hth: # rpm -q util-linux-ng dracut util-linux-ng-2.16-10.fc12.x86_64 dracut-002-8.git845dd502.fc12.noarch # dmesg|grep dracut dracut: dracut-002-8.git845dd502.fc12 dracut: Starting plymouth daemon dracut: Scanning devices vda2 for LVM volume groups dracut: Reading all physical volumes. This may take a while... dracut: Found volume group "VolGroup" using metadata type lvm2 dracut: 2 logical volume(s) in volume group "VolGroup" now active dracut: Mounted root filesystem /dev/mapper/VolGroup-lv_root dracut: Loading SELinux policy dracut: Switching root # rpm -q mkinitrd mkinitrd-6.0.93-1.fc12.x86_64 hmmm, this is something to do with selinux. I just disabled selinux (selinux=0) and no error... maybe sometype of policy restriction on ttyS's? Here is the avc: time->Wed Sep 30 14:54:14 2009 type=SYSCALL msg=audit(1254336854.428:24): arch=c000003e syscall=16 success=yes exit=0 a0=0 a1=540e a2=1 a3=676f6c2f7665642f items=0 ppid=1461 pid=1520 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=2 comm="login" exe="/bin/login" subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 key=(null) type=AVC msg=audit(1254336854.428:24): avc: denied { sys_admin } for pid=1520 comm="login" capability=21 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tclass=capability # ausearch -a 24 -ts recent | audit2allow -w type=AVC msg=audit(1254336854.428:24): avc: denied { sys_admin } for pid=1520 comm="login" capability=21 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tclass=capability Was caused by: The boolean allow_polyinstantiation was set incorrectly. Description: Enable polyinstantiated directory support. Allow access by executing: # setsebool -P allow_polyinstantiation 1 Suffice to say, setting that bool allows bash job control now. The question I have is whether this is just the console being configured incorrectly since we have never needed this access in the past. sys_admin is a powerful capability. I can turn it on easily enough and will in tonight's rawhide. But I would really like to know if it is really necessary. Daniel, I'm not sure I can answer the question you ask ... but I'm able to easily reproduce this by doing a 'serial console=ttyS0' KVM virt install of rawhide. I can give remote access to the system if that would help diagnose any changes which may have introduced this issue. (In reply to comment #9) > I just tried with mkinitrd... it doesn't happen. Interesting finding ... same issue here. mkinitrd booting doesn't exhibit the problem, while dracut ramdisk boot does. (In reply to comment #13) > Daniel, I'm not sure I can answer the question you ask The question is for Harald, I think Yes I guess Harald is the one who might be able to answer it. Could someone give the output of ps -AZ on a system that does not display the issue, then on one that does? That made a lot more sense in my head. What I meant to say is give the output of ps -AZ after booting with a mkinitrd initrd, then one with a dracut initrd. Created attachment 363347 [details]
`ps -AZ` when booting with dracut ramdisk
Created attachment 363348 [details]
`ps -AZ` when booting with mkinitrd ramdisk
interesting, init's TTY field is ttyS0 with dracut, but ? with mkinitrd ok, kzak, remove the ioctl() and setsid() from switch_root then (In reply to comment #22) > ok, kzak, remove the ioctl() and setsid() from switch_root then Fixed in the devel (F-13, rawhide), download the package from: http://koji.fedoraproject.org/koji/buildinfo?buildID=134822 Please, confirm the bugfix, then I'll update the package in F-12. Tested (In reply to comment #23) > (In reply to comment #22) > > ok, kzak, remove the ioctl() and setsid() from switch_root then > > Fixed in the devel (F-13, rawhide), download the package from: > http://koji.fedoraproject.org/koji/buildinfo?buildID=134822 > > Please, confirm the bugfix, then I'll update the package in F-12. Tested updated packages in a i386 kvm guest that was exhibiting this problem. The problem remains. Fedora release 11.91 (Rawhide) Kernel 2.6.31.1-56.fc12.i686.PAE on an i686 (/dev/ttyS0) test120.test.redhat.com login: root Password: Last login: Fri Oct 2 09:53:27 on ttyS0 -bash: cannot set terminal process group (-1): Inappropriate ioctl for device -bash: no job control in this shell [root@test120 ~]# rpm -qa util-linux-ng libblkid* uuid* util-linux-ng-2.16-12.fc13 libblkid-2.16-12.fc13 libuuid-2.16-12.fc13 (In reply to comment #24) > Tested updated packages in a i386 kvm guest that was exhibiting this problem. > The problem remains. I guess you need to rebuild your initrd by dracut. The bugfix is in the switch_root command witch we use in dracut initrd images. oh good, my guess was right - I suggested the same thing to jlaska during the blocker review meeting. He should provide updated test results soon. -- Fedora Bugzappers volunteer triage team https://fedoraproject.org/wiki/BugZappers I rebuilt the initrd using ... # rpm -q util-linux-ng libuuid libblkid util-linux-ng-2.16-12.fc13.x86_64 libuuid-2.16-12.fc13.x86_64 libblkid-2.16-12.fc13.x86_64 # dracut --force /boot/initramfs-$(uname -r).img $(uname -r) # uname -r 2.6.31.1-56.fc12.x86_64 # grep initramfs /etc/grub.conf initrd /initramfs-2.6.31.1-56.fc12.x86_64.img # reboot ... Fedora release 11.91 (Rawhide) Kernel 2.6.31.1-56.fc12.x86_64 on an x86_64 (/dev/ttyS0) test1221.test.redhat.com login: root Password: Last login: Fri Oct 2 14:54:11 on ttyS0 -bash: cannot set terminal process group (-1): Inappropriate ioctl for device -bash: no job control in this shell Could I still be doing something wrong? the patch isn't being applied... it's there, but it's missing the corresponding %patch13 to actually apply it in the spec :) (In reply to comment #28) > the patch isn't being applied... it's there, but it's missing the corresponding > %patch13 to actually apply it in the spec :) Grr... I'm sorry sorry sorry about it. James, test it with util-linux-ng-2.16-13.fc13, please. Updated testing with util-linux-ng-2.16-13.fc13 (http://koji.fedoraproject.org/koji/buildinfo?buildID=135078). That seems to have fixed the problem, thanks! Fedora release 11.91 (Rawhide) Kernel 2.6.31.1-56.fc12.i686.PAE on an i686 (/dev/ttyS0) test119.test.redhat.com login: root Password: Last login: Mon Oct 5 08:12:00 on ttyS0 [root@test119 ~]# rpm -q util-linux-ng libuuid libblkid util-linux-ng-2.16-13.fc13.i686 libuuid-2.16-13.fc13.i686 libblkid-2.16-13.fc13.i686 karel, can you send through an f12 build with this fix, and file a tag request to get it into the beta? -- Fedora Bugzappers volunteer triage team https://fedoraproject.org/wiki/BugZappers F-12 rebuild: util-linux-ng-2.16-10.2.fc12 Rel-eng Trac tag request: #2330 And tagged. *** Bug 527312 has been marked as a duplicate of this bug. *** |