[sheepdog] [PATCH] script: remove unused files

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Jan 30 02:45:52 CET 2013


Those scripts are obsolete and unlikely to be used in future.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 script/start-sheepdog |   60 -------------------------------------------------
 script/stop-sheepdog  |   33 ---------------------------
 2 files changed, 0 insertions(+), 93 deletions(-)
 delete mode 100755 script/start-sheepdog
 delete mode 100755 script/stop-sheepdog

diff --git a/script/start-sheepdog b/script/start-sheepdog
deleted file mode 100755
index 956aaeb..0000000
--- a/script/start-sheepdog
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/perl
-
-# Examples
-#
-# start-sheepdog -n=5 -d=/tmp/1203
-
-$port = 7000;
-$nr = 1;
- at hosts = ();
-$home = ".";
-
-$dir = "/tmp/".rand(100);
-
-while (@ARGV && $ARGV[0] =~ m/^-/) {
-    $_ = shift(@ARGV);
-
-    if (m/^-n=([0-9]*)$/) {
-	$nr = $1;
-    } elsif (m/^-d=(.*)$/) {
-	$dir = $1;
-    } elsif (m/^-h=(.*)$/) {
-	@hosts = &expand(split ':', $1);
-    } elsif (m/^-H=(.*)$/) {
-	$home = $1;
-    }
-}
-
-print("killing all sheepdogs...\n\n");
-system("$home/script/stop-sheepdog [0-100]");
-
-my %count;
-
-foreach $host (grep {!$count{$_}++} @hosts) {
-    system("$home/script/stop-sheepdog [0-100]");
-}
-
-for ($i = 0; $i < $nr; $i++, $port++) {
-    $_dir = $dir.$i;
-    if ($hosts[$i]) {
-	print("ssh $hosts[$i] $home/sheep/sheep --port $port $_dir -d\n");
-	system("ssh $hosts[$i] $home/sheep/sheep --port $port $_dir -d");
-    } else {
-	print("$home/sheep/sheep --port $port $_dir -d\n");
-	system("$home/sheep/sheep --port $port $_dir -d");
-    }
-}
-
-sub expand {
-    my @hosts = @_;
-    my @ret = ();
-    for my $host (@hosts) {
-	if ($host =~ /\[(\d+)-(\d+)\]/) {
-	    push @ret, &expand(map { $` . $_ . $' } ($1..$2));
-	} else {
-	    push @ret, $host;
-	}
-    }
-    return @ret;
-}
-
diff --git a/script/stop-sheepdog b/script/stop-sheepdog
deleted file mode 100755
index ad1b8a0..0000000
--- a/script/stop-sheepdog
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl
-
-# Examples
-#
-# stop-sheepdog 0 3 4
-# stop-sheepdog [0-100]
-
- at index_list = @ARGV;
-if (@index_list == 0) {
-    @index_list = (0);
-}
-
-$dport = 7000;
-
-foreach $proc (`ps -o pid,args -C sheep`) {
-    foreach $i (@index_list) {
-	if ($i =~ /\[(\d+)-(\d+)\]/) {
-	    &stop_dog($dport + $_) foreach ($1..$2);
-	} else {
-	    &stop_dog($dport + $i);
-	}
-    }
-}
-
-sub stop_dog {
-    my ($port) = @_;
-    if ($proc =~ /port $port/) {
-	$proc =~ s/^\s+(.*)/$1/;
-	($pid, @cmd) = split /\s/, $proc;
-	print "kill -9 $pid (@cmd)\n";
-	system "kill -9 $pid";
-    }
-}
-- 
1.7.2.5




More information about the sheepdog mailing list