From: Ian Campbell Subject: [PATCH OSSTEST v2] ts-logs-capture: ensure captured log files are readable. Date: Wed, 4 Feb 2015 11:51:35 +0000 Message-ID: <1423050695-23875-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At least /var/log/libvirt/libvirtd.log is 0600 on the target machine and this gets preserved in the captured logfile, eventually meaning that apache on the log server cannot read the file to serve it ("You don't have permission to access..."). Set all logfiles to 0666, modified by umask. Signed-off-by: Ian Campbell --- v2: Honour umask Currently visible at http://www.chiark.greenend.org.uk/~xensrcts/logs/34114/test-armhf-armhf-libvirt/marilith-n4---var-log-libvirt-libvirtd.log but not mentioning in the commit log since it'll go away before long. --- ts-logs-capture | 1 + 1 file changed, 1 insertion(+) diff --git a/ts-logs-capture b/ts-logs-capture index dbca13a..453b03d 100755 --- a/ts-logs-capture +++ b/ts-logs-capture @@ -59,6 +59,7 @@ END logm("fetching $logfile to $llogfile"); if (!eval { target_getfile_root($lho,60, $logfile,"$stash/$llogfile"); + chmod(0666&~umask, "$stash/$llogfile") or die "chmod $stash/$llogfile $!"; if ($logfile !~ m/\.gz$/) { stat("$stash/$llogfile") or die "$stash/$llogfile $!"; compress_stashed($llogfile) if(stat _)[7] > 100000; -- 2.1.4