Bug 161298
| Summary: | Can not log out after updating autofs | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 3 | Reporter: | John Newbigin <jn> | ||||||||
| Component: | autofs | Assignee: | Jeff Moyer <jmoyer> | ||||||||
| Status: | CLOSED NEXTRELEASE | QA Contact: | Brock Organ <borgan> | ||||||||
| Severity: | medium | Docs Contact: | |||||||||
| Priority: | medium | ||||||||||
| Version: | 3.0 | CC: | ikent | ||||||||
| Target Milestone: | --- | ||||||||||
| Target Release: | --- | ||||||||||
| Hardware: | i386 | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2007-01-17 19:25:10 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: | 190430 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
John Newbigin
2005-06-22 04:02:46 UTC
I'll try to reproduce this. Note that I do this sort of thing all of the time, and have not experienced this issue. This is still a problem when installing U6. After the update, the automount daemon is running with a terminal instead of as a daemon. # ps ax | grep automount 2615 ? S 1:08 /usr/sbin/automount --timeout=5 /misc program /root/miscmount.sh # rpm -U autofs-4.1.3-154.i386.rpm # ps ax | grep automount 1804 pts/0 S 0:00 /usr/sbin/automount --timeout=5 /misc program /root/miscmount.sh Still a problem in U7 ps -ef show that automount running with a controlling terminal root 23119 1 0 13:48 pts/1 00:00:00 /usr/sbin/automount --timeout=60 /home/students/accounts program /usr After logging out from ssh I have to use ~& to background the connection. Logging back in shows that automount is now running without a terminal root 23119 1 0 13:48 ? 00:00:00 /usr/sbin/automount --timeout=60 /home/students/accounts program /usr It looks to me like the become_daemon code in autofs should call setsid() to clear the controlling tty. Ian, and particular reason this isn't done? Ian, nevermind the above. It seems we are keeping some file descriptors open. I know that my daemon-exit-wait patch left one open, I'm pouring through the rest of the code to find other culprits. (In reply to comment #5) > Ian, nevermind the above. It seems we are keeping some file descriptors open. > I know that my daemon-exit-wait patch left one open, I'm pouring through the > rest of the code to find other culprits. There's patch around for 4.1.4 for that. I didn't notice until it was reported by the Debian folks. Many moons ago we would do a double fork to do this but there's only a single fork in become_daemon. I'll have a look around for the patch. Ian Created attachment 128769 [details]
Change setpgrp to setsid in become_daemon function
We should do this as well as hunt for the open file
handles. The become_daemon function is not incorrect.
Created attachment 128770 [details]
Change setpgrp to setsid in become_daemon function
We should do this as well as hunt for the open file
handles. The become_daemon function is incorrect.
OK, it turns out that this only happens from upgrading autofs, which points to RPM. RPM doesn't seem to set the close-on-exec bit for the file descriptors it opens, and so those get inherited by automount. I've modified the daemon to close fd's 0-255, and this appears to fix the problem. Note that this is the only change required, though I'll likely include the setsid patch as well. I'll follow up with a patch in a moment. The RPM bug I filed is bz #191196. Created attachment 128804 [details]
Close fd's 0-255 in become_daemon
Given that this particular issue is fixed in an RPM erratum, and given that RHEL 3 is only receiving critical updates, I'm closing this bug. The issue is addressed in RHEL 4. |