FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 01-19-2009, 10:36 PM
Ivan Kohler
 
Default Bug#508523: follow-up information on 2.6.26 vserver regression

To follow up on this problem, it appears that files created by "vserver
hashify" under 2.6.26 are missing the "U" attribute:

# /usr/sbin/showattr rate.pm
-----uI- rate.pm

The "I" (Immutable) flag is on, but the "U" flag which turns an
immutable file into a vserver-copy-on-write file is missing. (U stands
for Immutable-Invert-on-Unlink)

A file hashed under 2.6.25, or fixed manually ("/usr/sbin/setattr
--iunlink filename") looks like this:

# /usr/sbin/showattr rate.pm
-----UI- rate.pm

And of course, files which are not hashed across multiple vservers have
neither flag:

# /usr/sbin/showattr intlrates.csv
-----ui- intlrates.csv

Cc:ing util-vserver maintainer in case he has any input to add on what
"vserver hashify" from util-vserver does to create copy-on-write files
and why it might be failing on 2.6.26 but worked fine on 2.6.25.


Here is a quick script to fix permissions, for any folks having this
problem. I'm running this in my weekly vserver hashify cron job,
between the "vserver hashify" steps and the step to remove orphan files,
i.e.

#!/bin/sh
for a in `ls /var/lib/vservers/`; do mkdir -p /etc/vservers/$a/apps/vunify; vserver --verbose $a hashify; done
/home/ivan/fixvservers/fixvservers #kludge step
find /var/lib/vservers/.hash -type f -links 1 -print0 | xargs -0 rm


fixvservers script follows:

#!/usr/bin/perl

use File::Find;
use String::ShellQuote;

find( &wanted, '/var/lib/vservers' );

sub wanted {
my $dir = $File::Find::dir;
my $file = $_;
my $pathname = $File::Find::name;

return if $pathname =~ qr{^/var/lib/vservers/w+/(dev|proc)/};

return if -l $file
|| -p $file
|| -S $file
|| -b $file
|| -c $file
|| -t $file
;

$qfile = shell_quote $file;

chomp( my $showattr = `/usr/sbin/showattr -d $qfile` );
my( $attr, $fileagain ) = split(' ', $showattr);

return unless $attr =~ /^.....Ui.$/ || $attr =~ /^.....uI.$/;

#print "$attr $pathname
";

if ( $attr =~ /^.....Ui.$/ ) {
die "U but not I???";
#system("/usr/sbin/setattr --immutable $qfile");
} elsif ( $attr =~ /^.....uI.$/ ) {
system("/usr/sbin/setattr --iunlink $qfile");
} else {
die "guru meditation";
}

}

--
_ivan



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 05:05 PM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org