FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 02-25-2010, 01:01 PM
Ales Kozumplik
 
Default fix: Tackle race condition issues during X startup.

By forking the ssh initializtion into an orphan so SIGCHLDs coming from it do
not interfere.
---
anaconda | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/anaconda b/anaconda
index 116c54f..462f454 100755
--- a/anaconda
+++ b/anaconda
@@ -397,14 +397,28 @@ def createSshKey(algorithm, keyfile):
se = "/tmp/ssh-keygen-%s-stderr.log" % (algorithm,)
iutil.execWithRedirect('ssh-keygen', argv, stdout=so, stderr=se)

+def fork_orphan():
+ """Forks an orphan.
+
+ Returns 1 in the parent and 0 in the orphaned child.
+ """
+ intermediate = os.fork()
+ if not intermediate:
+ if os.fork():
+ # the intermediate child dies
+ os._exit(0)
+ return 0;
+ # the original process waits for the intermediate child
+ os.waitpid(intermediate, 0)
+ return 1
+
def startSsh():
if not flags.sshd:
return
if iutil.isS390():
return

- childpid = os.fork()
- if not childpid:
+ if not fork_orphan():
os.mkdir("/var/log", 0755)
os.open("/var/log/lastlog", os.O_RDWR | os.O_CREAT, 0644)
ssh_keys = {
@@ -1058,6 +1072,12 @@ if __name__ == "__main__":
# running on a redirected X display, so start local X server
if anaconda.displayMode == 'g' and not os.environ.has_key('DISPLAY') and not flags.usevnc:
try:
+ # The following code depends on no SIGCHLD being delivered, possibly
+ # only except the one from a failing X.org. Thus make sure before
+ # entering this section that all the other children of anaconda have
+ # terminated or were forked into an orphan (which won't deliver a
+ # SIGCHLD to mess up the fragile signaling below).
+
# start X with its USR1 handler set to ignore. this will make it send
# us SIGUSR1 if it succeeds. if it fails, catch SIGCHLD and bomb out.

--
1.6.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-11-2010, 12:53 PM
Ales Kozumplik
 
Default fix: Tackle race condition issues during X startup.

On 02/25/2010 03:01 PM, Ales Kozumplik wrote:

By forking the ssh initializtion into an orphan so SIGCHLDs coming from it do
not interfere.


Okay,

I've just seen it with rhel6 too while working on 572493.

Can someone please take the time and ACK this? Ask me over IRC if I need
to explain this more.


Thanks.
Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:18 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org