Skip to contentSkip to conversation

ts-logs-capture: ensure captured log files are readable.

PATCH Superseded Ian Campbell 2 participants 2 messages Feb 4, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ts-logs-capture: ensure captured log files are readable.

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...").

There seems to be no harm in setting all log files to 0664, so do so.

---
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(+)
ts-logs-capture +1 -0
index dbca13a..5a994c7 100755
@@ -59,6 +59,7 @@ END
             logm("fetching $logfile to $llogfile");
             if (!eval {
                 target_getfile_root($lho,60, $logfile,"$stash/$llogfile");
+		chmod(0664, "$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;
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 ts-logs-capture: ensure captured log files are readable.

Ian Campbell writes ("[PATCH OSSTEST] ts-logs-capture: ensure captured log files are readable."):

Quoted 6 lines

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...").

There seems to be no harm in setting all log files to 0664, so do so.

...

ts-logs-capture END · line 62

Quoted 1 line
ts-logs-capture +1 -0
+		chmod(0664, "$stash/$llogfile") or die "chmod $stash/$llogfile $!";

I think this is an unwarranted assumption about the umask, sadly.

Maybe you want 0666&~umask ?

Ian.