From: Horms <horms@verge.net.au>
To: xen-devel@lists.xensource.com
Subject: [PATCH] setsid() exception in xend
Date: Sat, 26 Nov 2005 11:43:44 +0000 (UTC) [thread overview]
Message-ID: <dm9hpf$jhr$1@sea.gmane.org> (raw)
# HG changeset patch
# User Horms <horms@verge.net.au>
# Node ID 37d3e34dfdac009eac2bb040ff79ae711b2d50f9
# Parent b9181b1c576fb39bb4d3b088ac3378d77163b4cc
For some reason that I can't quite put a finger on,
xend is a session leader well before the code in
SrvDaemon is called. This causes os.setsid() to
throw an exception.
This patch should be safe because the only exception
setsid should throw is if the current process is already
a session leader. So the process will either become
a session leader, or will already be one.
Signed-Off-By: Horms <horms@verge.net.au>
diff -r b9181b1c576f -r 37d3e34dfdac tools/python/xen/xend/server/SrvDaemon.py
--- a/tools/python/xen/xend/server/SrvDaemon.py Sat Nov 26 01:21:55 2005
+++ b/tools/python/xen/xend/server/SrvDaemon.py Sat Nov 26 11:37:18 2005
@@ -123,8 +123,12 @@
def daemonize(self):
if not XEND_DAEMONIZE: return
- # Detach from TTY.
- os.setsid()
+ # Detach from TTY
+ try:
+ os.setsid()
+ except:
+ # Already a session leader
+ pass
# Detach from standard file descriptors, and redirect them to
# /dev/null or the log as appropriate.
next reply other threads:[~2005-11-26 11:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-26 11:43 Horms [this message]
2005-11-28 4:29 ` [PATCH] setsid() exception in xend Horms
2005-11-28 11:31 ` Ewan Mellor
2005-11-28 12:53 ` Horms
2005-11-28 13:37 ` Ewan Mellor
2005-11-28 13:58 ` Horms
2005-11-28 15:57 ` Ewan Mellor
2005-11-29 1:51 ` Horms
2005-11-30 2:34 ` Horms
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='dm9hpf$jhr$1@sea.gmane.org' \
--to=horms@verge.net.au \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.