From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: [PATCH 3/3] Make xend start launch XenStore Date: Thu, 04 Aug 2005 11:05:39 -0500 Message-ID: <42F23CD3.8090907@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050202090203090105030607" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------050202090203090105030607 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The following patch makes tools/misc/xend start up the XenStore. It would be nicer to use init.d scripts to do this sort of stuff but this works for now. Signed-off-by: Anthony Liguori Regards, Anthony Liguori --------------050202090203090105030607 Content-Type: text/x-patch; name="xenstored_xend.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xenstored_xend.diff" diff -r 1d240086de52 tools/misc/xend --- a/tools/misc/xend Thu Aug 4 15:02:09 2005 +++ b/tools/misc/xend Thu Aug 4 10:59:48 2005 @@ -114,6 +114,14 @@ xcs_pidfile.close() except: return + +def start_xenstored(): + if os.fork() == 0: + os.execvp('/usr/sbin/xenstored', ['/usr/sbin/xenstored']); + +def start_consoled(): + if os.fork() == 0: + os.execvp('/usr/sbin/consoled', ['/usr/sbin/consoled']); def main(): try: @@ -130,11 +138,13 @@ return status >> 8 elif sys.argv[1] == 'start': start_xcs() - if os.fork() == 0: - os.execvp('/usr/sbin/consoled', ['/usr/sbin/consoled']); + start_xenstored() + start_consoled() return daemon.start() elif sys.argv[1] == 'trace_start': start_xcs() + start_xenstored() + start_consoled() return daemon.start(trace=1) elif sys.argv[1] == 'stop': stop_xcs() @@ -142,6 +152,8 @@ elif sys.argv[1] == 'restart': stop_xcs() start_xcs() + start_xenstored() + start_consoled() return daemon.stop() or daemon.start() elif sys.argv[1] == 'status': return daemon.status() --------------050202090203090105030607 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------050202090203090105030607--