From: John Levon Subject: [PATCH] open xend-debug.log with O_APPEND Date: Tue, 24 Oct 2006 22:34:39 +0100 Message-ID: <20061024213439.GA26260@totally.trollied.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline 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@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User john.levon@sun.com # Date 1161724855 25200 # Node ID 35cf7e0d5ba301b611713d95b8f863c20beb12db # Parent d9391864ed0e6727a204cfdbabdbaa6d00379f53 As spotted by Daniel Berrange, we must open xend-debug.log in append mode, otherwise a restart will write to the beginning of the log, making tail -f useless. Signed-off-by: John Levon diff --git a/tools/python/xen/xend/server/SrvDaemon.py b/tools/python/xen/xend/server/SrvDaemon.py --- a/tools/python/xen/xend/server/SrvDaemon.py +++ b/tools/python/xen/xend/server/SrvDaemon.py @@ -106,12 +106,12 @@ class Daemon: os.close(2) if XEND_DEBUG: os.open('/dev/null', os.O_RDONLY) - os.open(XEND_DEBUG_LOG, os.O_WRONLY|os.O_CREAT) + os.open(XEND_DEBUG_LOG, os.O_WRONLY|os.O_CREAT|os.O_APPEND) os.dup(1) else: os.open('/dev/null', os.O_RDWR) os.dup(0) - os.open(XEND_DEBUG_LOG, os.O_WRONLY|os.O_CREAT) + os.open(XEND_DEBUG_LOG, os.O_WRONLY|os.O_CREAT|os.O_APPEND) def start(self, trace=0):