From nobody Fri Mar 29 07:10:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562610618; cv=none; d=zoho.com; s=zohoarc; b=aUn1WIzn2wFFsbVwv6wxCh9VFey85kHGxxooNcEvZq13sxA/33zm5QUucP026qIoHc2z6qRrXRWy77nVO4qzpp6g2Rtsk6wlL01bOLgxoVKMoN+5hfN2wtDn5w36fh8tgTNh2QXhd9pCz/jyVPcmgmuBky/fLyIHcGgDSBRAr7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562610618; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=AMBcqrfu2otjhTnePDlpSFSRPSfa2If9IPrmKn8KtuU=; b=AKei+ItgkeLMYWRbFt6LchU4k0lxft+A4vsmK7oHOAppQeye5aq9YP39E9KUkYJ6HWRKlqCQHaC3l6DG7apmFIyihv2MG/04pjR7g/vfqYs6Nu7E0JqKhQF2lt6/tZuf0Acl9VPThgZTj5kt3qEft/x+DYwznTubN57Y33+/rgk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562610618359508.1466452311338; Mon, 8 Jul 2019 11:30:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D90E3086258; Mon, 8 Jul 2019 18:29:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1A305C2E0; Mon, 8 Jul 2019 18:29:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 40EAB206D2; Mon, 8 Jul 2019 18:29:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x68ISuQI015583 for ; Mon, 8 Jul 2019 14:29:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id ECDAE2B9F1; Mon, 8 Jul 2019 18:28:56 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E900C1898A for ; Mon, 8 Jul 2019 18:28:54 +0000 (UTC) Received: from smtp01.zerebecki.de (sammiittai.zerebecki.de [176.9.136.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8430530860AA for ; Mon, 8 Jul 2019 18:28:44 +0000 (UTC) Received: from ipservice-092-209-024-208.092.209.pools.vodafone-ip.de ([92.209.24.208] helo=localhost.localdomain) by smtp01.zerebecki.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hkYNW-0003XN-NN; Mon, 08 Jul 2019 20:28:42 +0200 From: Jan Zerebecki To: libvir-list@redhat.com Date: Mon, 8 Jul 2019 20:28:23 +0200 Message-Id: <20190708182823.26735-1-jan.suse@zerebecki.de> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, ACL 243 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 08 Jul 2019 18:28:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 08 Jul 2019 18:28:46 +0000 (UTC) for IP:'176.9.136.73' DOMAIN:'sammiittai.zerebecki.de' HELO:'smtp01.zerebecki.de' FROM:'jan.suse@zerebecki.de' RCPT:'' X-RedHat-Spam-Score: 0 (SPF_HELO_NONE, SPF_PASS) 176.9.136.73 sammiittai.zerebecki.de 176.9.136.73 sammiittai.zerebecki.de X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Jan Zerebecki Subject: [libvirt] [PATCHv2] Do not keep empty log files for deleted domains X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 08 Jul 2019 18:30:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" With logrotates copytruncate when e.g. domain1 doesn't exist anymore /var/log/libvirt/qemu/domain1.log will still exist after rotation even though it will never be written to. When new domain names keep getting used this leads to a lot of empty logfiles. This may lead to slowdown or lack of free disk space / inodes. Fix this by replacing copytruncate with the apropriate postrotate command to reopen log files. Thus after the apropriate time log files for deleted domains will be gone. This also has the advantage that the chance for loss of a few lines during copytruncate is gone. This only fixes the issue for qemu domains, others still have the same problem unfixed. Signed-off-by: Jan Zerebecki --- v2: drop changes to other logrotate confis src/remote/libvirtd.qemu.logrotate.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/remote/libvirtd.qemu.logrotate.in b/src/remote/libvirtd.qe= mu.logrotate.in index cdb399ef23..95407cec1a 100644 --- a/src/remote/libvirtd.qemu.logrotate.in +++ b/src/remote/libvirtd.qemu.logrotate.in @@ -4,5 +4,7 @@ rotate 4 compress delaycompress - copytruncate + postrotate + /usr/bin/killall -USR1 virtlogd + endscript } --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list