Bug 580321
| Summary: | /usr/sbin/pcscd exit codes broken | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Lennart Poettering <lpoetter> |
| Component: | pcsc-lite | Assignee: | Bob Relyea <rrelyea> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | 12 | CC: | kalevlember, ludovic.rousseau, rrelyea |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | pcsc-lite-1.6.1-1.fc14 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2010-07-03 23:32: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: | |||
|
Description
Lennart Poettering
2010-04-08 00:20:55 UTC
Adding upstream author Ludovic Rousseau to CC. I looked at the code and it appears that pcscd first calls daemon(), which makes the forked parent process return with exit code 0. After forking, the child process goes on to try to talk with hal. If the connection to hal fails, the _child_ process returns with a non-zero exit code. Ludovic, do you think it would be possible to fix it somehow so that the error condition is checked _before_ forking? You should not set up the HAL context before forking and then continue to use it after the fork. Most libraries cannot deal with forking and libdbus isn't any different there. Instead, create a pipe before forking and then have the child signal success/failure writing to the pipe and reading it on the parent process side. When daemonizing it is important that the child is fully providing its services when the parent process exits, since the exiting is used to synchronize startup. Hence you should do the pipe trick anyway. It means I can't use daemon(3) and must (manually) use fork(2) instead. daemon uses fork+exit but I need fork and later, after some code, exit. I will try to implement this. Fixed in revision 4969 http://lists.alioth.debian.org/pipermail/pcsclite-cvs-commit/2010-June/004521.html Thanks for fixing it, Ludovic! I just built pcsc-lite 1.6.1 in rawhide which includes the fix; closing the ticket. |