marsadm: check for matching version numbers

This commit is contained in:
Thomas Schoebel-Theuer 2013-04-17 11:03:13 +02:00
parent 67b322d600
commit 9187bf210d
1 changed files with 13 additions and 2 deletions

View File

@ -39,9 +39,10 @@ sub lwarn {
##################################################################
# global variables
# global variables and checks
my $Id = '$Id$';
my $Id = '$Id$ ';
my $user_version = 0.1;
my $mars = "/mars";
my $host = `uname -n` or ldie "cannot determine my network node name\n";
chomp $host;
@ -49,6 +50,16 @@ my $force = 0;
my $timeout = -1;
my $ip = _get_ip() or ldie "cannot determine my IP address\n";
if (! -d $mars) {
ldie "The $mars directory does not exist.\n";
}
if (! $1 =~ /cluster/) {
my $kernel_version = readlink("$mars/tree-$host");
if ($kernel_version && $user_version < $kernel_version) {
ldie "Sorry, your MARS kernel module uses version $kernel_version, but my $0 userspace version is only $user_version. That cannot work. Please upgrade your userspace scripts!\n";
}
}
##################################################################
# timeout handling